C
C   ROTOR AND WIND TUNNEL SUPPORT DYNAMICS
C   WAYNE JOHNSON         NASA-ARC/USAAMRDL
C   JANUARY 1976
C
      COMMON /WTCOEF/A2(1600),A1(1600),A0(1600),B0(560),MX,MX1,MV,MVG,DO-
     1F1(40)
      INTEGER DOF1
      COMMON /RCOEF/A2R(30,30),A1R(30,30),A0R(30,30),AA2R(30,6),AA1R(30,-
     16),AA0R(30,6),BR(30,8),BGR(30,3),C2R(6,30),C1R(6,30),C0R(6,30),CA2-
     2R(6,6),CA1R(6,6),CA0R(6,6),DGR(6,3)
      COMMON /SCOEF/CAW(6,10),A2W(10,10),A1W(10,10),A0W(10,10),BW(10,3),-
     1BGW(10,3),AAW(10,6),MXS,MVS
      COMMON /TINPUT/TITLE(18),ASHAFT,IMOTOR,RTRANS,OPTRIM,OPSTRT,CON(11-
     1),VEL,VKTS,DOF(40), OPLMDA,GUST(3),OPMOTR,OPFLOW,MPER,JCNST,DEBUG,-
     2NSYSAN,NSTEP,NFREQ,ITER,CQTRIM,CTTRIM,EPTRIM,FACTOR,PLOTMX,LOCUS,R-
     3ESPON,NF,DOFP(40),CONP(14),OPREAD,EDAMPC,VTIP,RPM,T75,T1C,T1S,CTLM-
     4DA,OPTORS,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST(3,3),EDAMP,-
     5KMAST,KICS,KPGOVR,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR,FREQ(100)
      REAL IMOTOR,KMAST,KICS,KPGOVR,KIGOVR
      INTEGER OPTRIM,OPSTRT,DOF,CON,GUST,OPMOTR,OPFLOW,DEBUG,RESPON,DOFP-
     1,CONP,OPLMDA,OPREAD,OPTORS,OPUNIT,ORIENT,OPGOVR
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (RADIUS,HHR(14)),(VTIPN,HHR(79)),(NBLADE,HHR(2)),(GIMB-
     1AL,HHR(11)),(NBM,HHR(9)),(NTM,HHR(10)),(OPAERO,HHR(16)),(OPMODE,HH-
     2R(26)),(GAMMA,HHR(12)),(SIGMA,HHR(15)),(MU,HHR(6)),(LAMDA,HHR(7)),-
     3(MUY,HHR(88)),(MUZ,HHR(89)),(KPB(1),HHR(50)),(KPG,HHR(35)),(TRC,HH-
     4R(21)),(TRS,HHR(22)),(IB,HHR(32)),(OMEGA,HHR(13)),(KHLMDA,HHR(655)-
     5),(KFLMDA,HHR(656)),(ROTATE,HHR(663))
      REAL MU,LAMDA,MUY,MUZ,KPG,KPB(5),IB,KHLMDA,KFLMDA
      INTEGER GIMBAL,OPAERO,OPMODE,ROTATE
      NAMELIST /NLCYC/NCYCLE
      NAMELIST /NLWT/TITLE,VEL,VKTS,DOF,CON,GUST,OPMOTR,OPFLOW,MPER,JCNS-
     1T,DEBUG,NSYSAN,NSTEP,NFREQ,FREQ,OPSTRT,ASHAFT,PLOTMX,LOCUS,RESPON,-
     2NF,DOFP,CONP,IMOTOR,RTRANS,IMSTAR,OPTRIM,ITER,CQTRIM,CTTRIM,EPTRIM-
     3,FACTOR,OPLMDA,EDAMP,VTIP,RPM,OPREAD,CTLMDA,OPTORS,EDAMPC,T75,T1C,-
     4T1S,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST,KMAST,KICS,KPGOVR-
     5,KPGOVC,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR
      NAMELIST /NLEQ/A2,A1,A0,B0,MX,MX1,MV,MVG,DOF0,DOF1
      NAMELIST /NLR/A2R,A1R,A0R,AA2R,AA1R,AA0R,BR,BGR,C2R,C1R,C0R,CA2R,C-
     1A1R,CA0R,DGR
      NAMELIST /NLS/ CAW,A2W,A1W,A0W,BW,BGW,AAW,MXS,MVS
      DIMENSION B(440),BG(120),PHI(1800),C2H(6,10),C1H(6,10),C0H(6,10)
      REAL IMSTAR,KPGOVC,CUNIT(2),BGH(30,3),DGH(6,3),CSSTD(2)
      INTEGER DOF0(40)
      EQUIVALENCE (B0(1),B(1)),(B0(441),BG(1))
      EQUIVALENCE (BGH(1,1),B(1)),(DGH(1,1),B(91)),(C0H(1,1),B(1)),(C1H(-
     11,1),B(61)),(C2H(1,1),B(121))
      DATA CSSTD/1117.,340.3/
      DATA CUNIT/.5924838,1.943845/
      DATA CVERT/57.29578/
  999 FORMAT (1H1/1X,18A4//)
  998 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'HELICOPTER',30X,                                                 -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'SHAFT ANGLE (DEG) =',F7.2,14X,                                   -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,13X, -
     6'YAW ANGLE (DEG)   =',F7.2,14X,                                   -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,53X,                                                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  997 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'PROPELLER',31X,                                                  -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'YAW ANGLE (DEG) =',F7.2,16X,                                     -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,53X, -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,53X,                                                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  996 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'PROPROTOR',31X,                                                  -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'TILT ANGLE (DEG)   =',F7.2,13X,                                  -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,13X, -
     6'CRUISE ANGLE (DEG) =',F7.2,13X,                                  -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,13X,'CANT ANGLE (DEG)   =',F7.2,13X,                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  994 FORMAT (///1X,'OPTIONS'/                                          -
     110X,'OPFLOW =',I2,10X,'IF 0, AXIAL FLOW/ LT 0, CONSTANT COEFF/ GT -
     20, PERIODIC COEFF'/                                               -
     310X,'OPMOTR =',I2,10X,'IF 0, AUTOROTATION/ IF 1, CONSTANT SPEED/ I-
     AF 2, MOTOR/ IF 3, POWER OUT/ LT 0, ANTISYMMETRIC'/                -
     410X,'OPTORS =',I2,10X,'IF 0, DOF/ IF 1, RIGID/ IF 2, QUASISTATIC'/-
     510X,'OPAERO =',I2,10X,'IF 0, ONLY CLA TERMS IN ROTOR AERODYNAMICS/-
     6 LT 0, NO STALL'/                                                 -
     710X,'OPTRIM =',I2,10X,'IF 0, NO TRIM/LT 0, NO ITER/IF 1, TRIM T/IF-
     B 2, TRIM Q/IF 3, TRIM T AND FLAP/IF 4, TRIM L,X,Y'/               -
     810X,'OPMODE =',I2,10X,'IF 0, RIGID BLADE MODES/ IF 2, READ MODES/ -
     9IF 3, PUNCH MODES/ IF 4, ARTICULATED MODES'/                      -
     C10X,'OPLMDA =',I2,10X,'IF 0, QUASISTATIC INFLOW DYNAMICS'/        -
     D10X,'OPGOVR =',I2,10X,'IF 0, NO GOVERNOR/ IF 1, GOVERNOR/ IF 2, IN-
     EPUT GAINS')
  993 FORMAT (///1X,'ORDER OF VARIABLES'/10X,'DOF = B0,B1C,B1S,BNC,BNS,B-
     1N/2   T0,T1C,T1S,TNC,TNS,TN/2   BGC,BGS,PSI   L0,LC,LS   SUPPORT'/-
     210X,'CON = T0,T1C,T1S,TNC,TNS,TN/2   SUPPORT'/                    -
     310X,'GUST = UG,VG,WG')
  992 FORMAT (///10X,'DOF =',1X,15I1,3X,9I1,3X,3I1,3X,3I1,3X,10I1/10X, '-
     1CON =',1X,8I1,3X,3I1/10X,'GUST =',1X,3I1)
  991 FORMAT (///1X,'COMPUTATION PARAMETERS',20X,'PSYSAN - STEPS =',I4,1-
     12X,'CSYSAN - STEPS =',I4/43X,'ROOT LOCUS =',I3,17X,'FREQ RESPONSE -
     2=',I3/43X,'PLOT MAX =',F7.2,15X,'NUMBER OF FREQ =',I4/43X,'DOF PLO-
     3T = ',40I1)
  989 FORMAT (43X,'CON AND GUST PLOT =',14I1)
  988 FORMAT (1X,'ENGLISH UNITS (FT, SLUG, SEC)')
  987 FORMAT (1X,'METRIC UNITS (M, KG, SEC)')
  984 FORMAT (90X,'CLOCKWISE ROTATION')
  985 FORMAT (90X,'COUNTER-CLOCKWISE ROTATION')
  990 FORMAT (2X,'CALL PSYSAN,  NT =',I4)
      READ (5,NLCYC)
      DO 1 JCYCLE=1,NCYCLE
      VEL=0.
      VKTS=0.
      VTIP=0.
      RPM=0.
      READ (5,NLWT)
      IF ((OPUNIT .NE. 1) .AND. (OPUNIT .NE. 2)) OPUNIT=1
      IF ((RPM .NE. 0.) .AND. (VTIP .EQ. 0.)) VTIP=RADIUS*RPM*.1047198
      IF (VTIP .EQ. 0.) VTIP=VTIPN
      IF (RPM .EQ. 0.) RPM=VTIP/RADIUS/.1047198
      IF (VEL .EQ. 0.) VEL=VKTS/VTIP/CUNIT(OPUNIT)
      IF (VKTS .EQ. 0.) VKTS=VEL*VTIP*CUNIT(OPUNIT)
      CSOUND=CSSTD(OPUNIT)
      CALL RTRII(OPREAD,DEBUG,VTIP,T75,T1C,T1S,DENSE,CSOUND,OPUNIT)
      IF ((OPTRIM .EQ. 1) .OR. (OPTRIM .GE. 3)) CTLMDA=CTTRIM*SIGMA
      IF ((OPMOTR .NE. 0) .AND. (IABS(OPMOTR) .NE. 3)) GO TO 126
      CQTRIM=0.
      IF (OPTRIM .GT. 0) OPTRIM=2
  126 CONTINUE
      IF ((OPMOTR.EQ.1).OR.(DOF(27).EQ.0).OR.(OPMOTR.LT.0)) OPGOVR=0
      DO 24 K=1,40
      IF (DOF(K) .NE. 0) DOF(K)=1
      IF (NBLADE .NE. 1) GO TO 125
      IF ((K .GE. 6) .AND. (K .LE. 15)) DOF(K)=0
      IF ((K .GE. 19) .AND. (K .LE. 40)) DOF(K)=0
      GO TO 24
  125 IF (NBLADE .NE. 2) GO TO 24
      IF ((K .GE. 11) .AND. (K .LE. 15)) DOF(K)=0
      IF ((K .GE. 22) .AND. (K .LE. 24)) DOF(K)=0
      DOF(26)=0
   24 CONTINUE
      DO 25 K=1,11
      IF (CON(K) .NE. 0) CON(K)=1
      IF ((K .GT. NBLADE) .AND. (K .LE. 8)) CON(K)=0
      IF ((NBLADE .EQ. 1) .AND. (K .NE. 1)) CON(K)=0
   25 CONTINUE
      DO 26 K=1,3
      IF (GUST(K) .NE. 0) GUST(K)=1
      IF (NBLADE .EQ. 1) GUST(K)=0
   26 CONTINUE
      IF (OPTORS .NE. 1) GO TO 121
      DO 122 K=16,24
  122 DOF(K)=0
      GO TO 123
  121 K1=15+NBLADE
      DO 124 K=16,K1
  124 DOF(K)=1
  123 CONTINUE
      IF (GIMBAL .EQ. 0) DOF(25)=0
      IF (GIMBAL .EQ. 0) DOF(26)=0
      IF (OPMOTR .EQ. 1) DOF(27)=0
      NBM=0
      DO 21 K=1,5
      DO 21 KB=1,NBLADE
      J=(K-1)*NBLADE+KB
      IF (J .GT. 15) GO TO 21
      IF (DOF(J) .NE. 0) NBM=K
   21 CONTINUE
      NBM=MAX0(1,NBM)
      NTM=0
      DO 22 K=1,3
      DO 22 KB=1,NBLADE
      J=(K-1)*NBLADE+KB
      IF (J .GT. 9) GO TO 22
      IF (DOF(J+15) .NE. 0) NTM=K
   22 CONTINUE
      NTM=MAX0(1,NTM)
      MXP=0
      MVP=0
      DO 161 I=1,40
      IF ((I .GE. 16) .AND. (I .LE. 24) .AND. (OPTORS .EQ. 2)) GO TO 161
      IF ((I .GE. 28) .AND. (I .LE. 30) .AND. (OPLMDA .EQ. 0)) GO TO 161
      MXP=MXP+DOF(I)
  161 CONTINUE
      DO 164 I=1,11
  164 MVP=MVP+CON(I)
      DO 165 I=1,3
  165 MVP=MVP+GUST(I)
      PRINT 999, (TITLE(I), I=1,18)
      IF (ORIENT .EQ. 1) PRINT 998, VKTS,RADIUS,VEL,ASHAFT,OMEGA,VTIP,AY-
     1AW,IB,RPM,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ORIENT .EQ. 2) PRINT 997, VKTS,RADIUS,VEL,AYAW,OMEGA,VTIP,IB,R-
     1PM,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ORIENT .EQ. 3) PRINT 996, VKTS,RADIUS,VEL,ATILT,OMEGA,VTIP,ASH-
     1AFT,IB,RPM,ACANT,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ROTATE .EQ. 1)  PRINT 985
      IF (ROTATE .EQ. -1) PRINT 984
      PRINT 994, OPFLOW,OPMOTR,OPTORS,OPAERO,OPTRIM,OPMODE,OPLMDA,OPGOVR
      PRINT 993
      PRINT 992, (DOF(I), I=1,40),(CON(I), I=1,11),(GUST(I), I=1,3)
      PRINT 991, MPER,JCNST,LOCUS,RESPON,PLOTMX,NF,(DOFP(I),I=1,MXP)
      PRINT 989, (CONP(I), I=1,MVP)
      IF (OPUNIT .EQ. 1) PRINT 988
      IF (OPUNIT .EQ. 2) PRINT 987
      CALL MODE
      CALL WTTRIM
      PERIOD=6.283185/FLOAT(NBLADE)
      IF (NBLADE/2*2 .EQ. NBLADE) PERIOD=2.*PERIOD
      DT=PERIOD/FLOAT(MPER)
      MT=0
      IF (OPFLOW .GT. 0) MT=MPER
      MT1=MT+1
      NBLD=NBLADE
      IF (OPFLOW .LT. 0) NBLD=JCNST
      DO 2 JT=1,MT1
      NT=JT-1
      PSI=FLOAT(NT)*DT
      IF ((NBLADE.GE.3).AND.(OPFLOW.EQ.0)) CALL ROTOR0
      IF ((NBLADE.GE.3).AND.(OPFLOW.NE.0)) CALL ROTOR(OPFLOW,PSI,NBLD)
      IF (NBLADE .EQ. 2) CALL ROTOR2(OPFLOW,PSI,NBLD)
      IF (NBLADE .EQ. 1) CALL ROTOR1(OPFLOW,PSI,NBLD)
      IF (OPFLOW .GT. 0) GO TO 235
      DO 230 I=1,3
      DO 232 J=1,30
      BGH(J,I)=0.
      DO 232 K=1,3
  232 BGH(J,I)=BGH(J,I)+BGR(J,K)*RST(K,I)
      DO 231 J=1,6
      DGH(J,I)=0.
      DO 231 K=1,3
  231 DGH(J,I)=DGH(J,I)+DGR(J,K)*RST(K,I)
  230 CONTINUE
      DO 233 I=1,3
      DO 234 J=1,30
  234 BGR(J,I)=BGH(J,I)
      DO 233 J=1,6
  233 DGR(J,I)=DGH(J,I)
  235 IF ((OPMOTR .EQ. 0) .OR. (OPMOTR .EQ. 1)) GO TO 236
      IMSTAR=IMOTOR/(FLOAT(NBLADE)*IB)*RTRANS**2
      IF (OPMOTR .LT. 0) GO TO 237
      A2R(27,27)=A2R(27,27)+IMSTAR
      A1R(27,27)=A1R(27,27)+EDAMP
      GO TO 236
  237 CNST1=1.+KICS/KMAST
      A2R(27,27)=A2R(27,27)+IMSTAR/CNST1
      A1R(27,27)=A1R(27,27)+EDAMP/CNST1
      A0R(27,27)=A0R(27,27)+KICS/(FLOAT(NBLADE)*IB*OMEGA**2*CNST1)
  236 CNST1=GAMMA/(SIGMA*5.7)*DENSE
      A2R(28,28)=A2R(28,28)+.85*CNST1
      A2R(29,29)=A2R(29,29)+.22*CNST1
      A2R(30,30)=A2R(30,30)+.22*CNST1
      CNST2=SQRT((MU**2+MUY**2)/KFLMDA**2+LAMDA**2/KHLMDA**4)
      A1R(28,28)=A1R(28,28)+2.*CNST1*(CNST2+(LAMDA-MUZ)*LAMDA/KHLMDA**4/-
     1CNST2)
      A1R(29,29)=A1R(29,29)+CNST1*CNST2
      A1R(30,30)=A1R(30,30)+CNST1*CNST2
      CALL STRUT(OPSTRT)
      DO 31 I=1,30
      DO 31 K=1,30
      JA=(I-1)*40+K
      A2(JA)=A2R(K,I)
      A1(JA)=A1R(K,I)
   31 A0(JA)=A0R(K,I)
      IF (NBLADE .EQ. 1) GO TO 130
      DO 32 I=1,MXS
      DO 32 K=1,30
      JA=(I+29)*40+K
      A2(JA)=0.
      A1(JA)=0.
      A0(JA)=0.
      DO 32 J=1,6
      A2(JA)=A2(JA)+AA2R(K,J)*CAW(J,I)
      A1(JA)=A1(JA)+AA1R(K,J)*CAW(J,I)
   32 A0(JA)=A0(JA)+AA0R(K,J)*CAW(J,I)
      DO 33 I=1,30
      DO 33 K=1,MXS
      JA=(I-1)*40+K+30
      A2(JA)=0.
      A1(JA)=0.
      A0(JA)=0.
      DO 33 J=1,6
      A2(JA)=A2(JA)-AAW(K,J)*C2R(J,I)
      A1(JA)=A1(JA)-AAW(K,J)*C1R(J,I)
   33 A0(JA)=A0(JA)-AAW(K,J)*C0R(J,I)
      DO 34 I=1,MXS
      DO 34 K=1,6
      C2H(K,I)=0.
      C1H(K,I)=0.
      C0H(K,I)=0.
      DO 34 J=1,6
      C2H(K,I)=C2H(K,I)+CA2R(K,J)*CAW(J,I)
      C1H(K,I)=C1H(K,I)+CA1R(K,J)*CAW(J,I)
   34 C0H(K,I)=C0H(K,I)+CA0R(K,J)*CAW(J,I)
      DO 35 I=1,MXS
      DO 35 K=1,MXS
      JA=(I+29)*40+K+30
      A2(JA)=A2W(K,I)
      A1(JA)=A1W(K,I)
      A0(JA)=A0W(K,I)
      DO 35 J=1,6
      A2(JA)=A2(JA)-AAW(K,J)*C2H(J,I)
      A1(JA)=A1(JA)-AAW(K,J)*C1H(J,I)
   35 A0(JA)=A0(JA)-AAW(K,J)*C0H(J,I)
  130 IF (OPFLOW .GT. 0) GO TO 30
      DO 137 I=1,8
      DO 136 K=1,30
      JB=(I-1)*40+K
  136 B(JB)=BR(K,I)
      DO 137 K=1,MXS
      JB=(I-1)*40+K+30
  137 B(JB)=0.
      IF (NBLADE .EQ. 1) GO TO 30
      DO 39 I=1,MVS
      DO 38 K=1,30
      JB=320+(I-1)*40+K
   38 B(JB)=0.
      DO 39 K=1,MXS
      JB=350+(I-1)*40+K
   39 B(JB)=BW(K,I)
      DO 37 I=1,3
      DO 36 K=1,30
      JB=(I-1)*40+K
   36 BG(JB)=BGR(K,I)
      DO 37 K=1,MXS
      JB=(I-1)*40+K+30
      BG(JB)=BGW(K,I)
      DO 37 J=1,6
   37 BG(JB)=BG(JB)+AAW(K,J)*DGR(J,I)
   30 CONTINUE
      IF (OPTORS .EQ. 0) GO TO 40
      IF (OPTORS .EQ. 2) GO TO 41
      JN=40*NBLADE
      DO 42 J=1,JN
   42 B(J)=-A0(J+600)
      DO 141 I=1,NBM
      DO 141 J=1,JN
      JA=(I-1)*JN+J
      IF (JA .GT. 600) GO TO 141
      A0(JA)=A0(JA)-KPB(I)*A0(J+600)
  141 CONTINUE
      IF (GIMBAL .EQ. 0) GO TO 142
      JN=80
      IF (NBLADE .EQ. 2) JN=40
      DO 43 J=1,JN
   43 A0(J+960)=A0(J+960)-KPG*A0(J+640)
  142 IF (OPFLOW .EQ. 0) GO TO 143
      IF (NBLADE .EQ. 2) GO TO 144
      DO 145 J=1,40
  145 A0(J+1040)=A0(J+1040)+TRS*A0(J+640)-TRC*A0(J+680)
      GO TO 143
  144 TCYC=-TRC*SIN(PSI)+TRS*COS(PSI)
      DO 146 J=1,40
  146 A0(J+1040)=A0(J+1040)+TCYC*A0(J+640)
  143 GO TO 40
   41 DO 44 I=1,40
      DO 44 J=1,9
      JA=(I-1)*40+J+15
      A2(JA)=0.
      IF ((I .GE. 28) .AND. (I .LE. 30)) GO TO 44
      A1(JA)=0.
   44 CONTINUE
   40 IF (OPGOVR .EQ. 0) GO TO 50
      KPGOVC=KPGOVR*OMEGA
      IF (OPGOVR .NE. 2) KPGOVC=KPGOVC*AMAX1(0.,AMIN1(1.,ATILT/90.))
      DO 51 I=1,40
      A0(I+1040)=A0(I+1040)-KIGOVR*B(I)
   51 A1(I+1040)=A1(I+1040)-KPGOVC*B(I)
   50 MX=0
      MX1=0
      MX0=0
      MV=0
      MVG=0
      DO 61 I=1,40
      MX=MX+DOF(I)
      DOF1(I)=1
   61 DOF0(I)=1
      IF ((OPFLOW.NE.0).OR.(OPMOTR.LT.0).OR.(OPGOVR.NE.0)) GO TO 67
      DOF1(27)=0
      IF (DOF(27) .NE. 0) MX1=1
   67 DO 66 I=28,30
      DOF1(I)=0
      IF (DOF(I) .EQ. 0) GO TO 66
      MX1=MX1+1
      IF (OPLMDA .NE. 0) GO TO 66
      DOF0(I)=0
      MX0=MX0+1
   66 CONTINUE
      IF (OPTORS .NE. 2) GO TO 62
      DO 63 I=16,24
      IF (DOF(I) .EQ. 0) GO TO 63
      DOF0(I)=0
      MX0=MX0+1
   63 CONTINUE
   62 DO 64 I=1,11
   64 MV=MV+CON(I)
      DO 65 I=1,3
   65 MVG=MVG+GUST(I)
      CALL DERED(40,11,3,DOF,CON,GUST,A2,A1,A0,B,BG,DOF1,DOF0)
      MVX=MX*MV
      MVGX=MX*MVG
      DO 81 I=1,MVGX
      I1=I+MVX
   81 B0(I1)=BG(I)
      MV=MV+MVG
   80 CONTINUE
      IF ((OPLMDA .EQ. 0) .OR. (OPTORS .EQ. 2)) CALL QSTRAN(MX,MX0,MX1,M-
     1V,A2,A1,A0,B0,DOF1,DOF0)
      IF (DEBUG .EQ. 0) GO TO 83
      MXSQ1=MX*MX+1
      IF (MXSQ1 .GT. 1600) GO TO 84
      DO 85 I=MXSQ1,1600
      A2(I)=0.
      A1(I)=0.
   85 A0(I)=0.
   84 MVX1=MX*MV+1
      IF (MVX1 .GT. 560) GO TO 83
      DO 86 I=MVX1,560
   86 B0(I)=0.
   83 CONTINUE
      IF (DEBUG .GE. 2) WRITE(6,NLWT)
      IF (DEBUG .EQ. 3) WRITE(6,NLR)
      IF (DEBUG .EQ. 3) WRITE(6,NLS)
      IF ((DEBUG .EQ. 1) .OR. (DEBUG .EQ. 3)) WRITE(6,NLEQ)
      IF (OPFLOW .GT. 0) GO TO 3
      CALL CSYSAN(NSYSAN,MX,MX1,MV,A2,A1,A0,B0,NFREQ,FREQ,NSTEP,DOF1,OME-
     1GA)
      IF (LOCUS .GT. 0) CALL RPLOT(MX,MX1,JCYCLE,PLOTMX,LOCUS)
      IF ((RESPON .GT. 0) .AND. (LOCUS .LE. 0)) CALL TRANS(B0,MX,MX1,MV,-
     1RESPON,NF,DOFP,CONP)
      GO TO 2
    3 NSYSAN=0
      PRINT 990, NT
      CALL PSYSAN(NSYSAN,MX,MX1,A2,A1,A0,PHI,DT,NT,MT,PERIOD,MT,DOF1)
    2 CONTINUE
    1 CONTINUE
      IF ((LOCUS .GT. 0) .OR. (RESPON .GT. 0)) CALL ENPLT(10.,0.)
      STOP
      END
      SUBROUTINE WTTRIM
      COMMON /TINPUT/HHT(285)
      EQUIVALENCE (ASHAFT,HHT(19)),(OPTRIM,HHT(22)),(VEL,HHT(35)),(OPFLO-
     1W,HHT(82)),(ITER,HHT(89)),(CQTRIM,HHT(90)),(CTTRIM,HHT(91)),(EPTRI-
     2M,HHT(92)),(FACTOR,HHT(93)),(CTLMDA,HHT(159)),(OPMOTR,HHT(81)),(ED-
     3AMP,HHT(176)),(EDAMPC,HHT(153)),(DENSE,HHT(161)),(BCTRIM,HHT(163))-
     4,(BSTRIM,HHT(164)),(CXTRIM,HHT(165)),(CYTRIM,HHT(166)),(RST(1,1),H-
     5HT(167)),(ORIENT,HHT(181)),(AYAW,HHT(182)),(ACANT,HHT(183)),(ATILT-
     6,HHT(184))
      INTEGER OPTRIM,OPFLOW,OPMOTR,ORIENT
      REAL RST(3,3)
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (THETA(1),HHR(294)),(T1C,HHR(21)),(T1S,HHR(22)),(LAMDA-
     1,HHR(7)),(MU,HHR(6)),(MUY,HHR(88)),(MUZ,HHR(89)),(MTIP,HHR(8)),(SI-
     2GMA,HHR(15)),(NTRIM0,HHR(4)),(NTRIM1,HHR(5)),(GAMMA,HHR(12)),(VTOT-
     3,HHR(654)),(KHLMDA,HHR(655)),(KFLMDA,HHR(656)),(ALFHP,HHR(657)),(P-
     4SIHP,HHR(658)),(IRING,HHR(662)),(ROTATE,HHR(663))
      INTEGER ROTATE
      REAL MU,MUY,MUZ,LAMDA,MTIP,THETA(51),KHLMDA,KFLMDA
      COMMON /MODES/ETA(5,2,51),ETAP(5,2,51),ETAPP(5,2,51),NU(5),ZETA(3,-
     151),ZETAP(3,51),WT(3),EFA(5,2),EFAP(5,2),EFAPP(5,2)
      REAL NU
      COMMON /ZTRIM/B0(5),B1C(5),B1S(5),B2C(5),B2S(5),BGC,BGS,CT,CH,CY,C-
     1MX,CMY,CQ,HHHT(2342)
      INTEGER LMINV(4),MMINV(4)
      REAL DERIV(9),ZERO(2375)
      EQUIVALENCE (ZERO(1),B0(1))
      DATA CVERT/57.29578/
  999 FORMAT (1H1,'PERFORMANCE AND TRIM'/)
  998 FORMAT (////5X,'NO TRIM')
  997 FORMAT (5X,'NO FORCE TRIM')
  996 FORMAT (5X,'TARGET CT/S =',F10.6)
  995 FORMAT (5X,'TARGET CQ/S =',F10.6)
  994 FORMAT (5X,'TARGETS',5X,'CT/S =',F10.6,10X,'B1C =',F6.2,' DEG',10X-
     1,'B1S =',F6.2,' DEG')
  993 FORMAT (5X,'TARGETS',5X,'CL/S =',F10.6,10X,'CX/S =',F10.6,10X,'CY/-
     1S =',F10.6)
  990 FORMAT (5X,'FORCE TRIM ITERATIONS =',I4,7X,'(MAXIMUM =',I4,',  TOL-
     1ERANCE =',F7.4,')')
      DO 10 J=1,33
   10 ZERO(J)=0.
      GO TO (21,22,23),ORIENT
   21 COST=COS(ASHAFT/CVERT)
      SINT=SIN(ASHAFT/CVERT)
      COSP=COS(AYAW/CVERT)
      SINP=SIN(AYAW/CVERT)
      RST(1,1)=COST*COSP
      RST(2,1)=SINP
      RST(3,1)=SINT*COSP
      RST(1,2)=-COST*SINP
      RST(2,2)=COSP
      RST(3,2)=-SINT*SINP
      RST(1,3)=-SINT
      RST(2,3)=0.
      RST(3,3)=COST
      GO TO 24
   22 COSP=COS(AYAW/CVERT)
      SINP=SIN(AYAW/CVERT)
      RST(1,1)=-SINP
      RST(2,1)=0.
      RST(3,1)=-COSP
      RST(1,2)=-COSP
      RST(2,2)=0.
      RST(3,2)=SINP
      RST(1,3)=0.
      RST(2,3)=1.
      RST(3,3)=0.
      GO TO 24
   23 COSA=COS(ATILT/CVERT)
      SINA=SIN(ATILT/CVERT)
      COST=COS(ASHAFT/CVERT)
      SINT=SIN(ASHAFT/CVERT)
      COSP=COS(ACANT/CVERT)
      SINP=SIN(ACANT/CVERT)
      RST(3,3)=(COSP**2*COSA+SINP**2)*SINT+COSP*SINA*COST
      RST(3,2)=-SINP*COSP*(1.-COSA)
      RST(3,1)=-(COSP**2*COSA+SINP**2)*COST+COSP*SINA*SINT
      RST(2,3)=-SINP*COSP*(1.-COSA)*SINT+SINP*SINA*COST
      RST(2,2)=COSP**2+SINP**2*COSA
      RST(2,1)=SINP*COSP*(1.-COSA)*COST+SINP*SINA*SINT
      RST(1,3)=-SINA*COSP*SINT+COSA*COST
      RST(1,2)=-SINA*SINP
      RST(1,1)=SINA*COSP*COST+COSA*SINT
   24 CSII=RST(1,1)
      CSJI=RST(2,1)
      CSKI=RST(3,1)
      VTOT=0.
      MU=0.
      MUY=0.
      IF (OPFLOW .EQ. 0) GO TO 27
      MU=VEL*CSII
      MUY=-VEL*CSJI*FLOAT(ROTATE)
      VTOT=MU*MU+MUY*MUY
      IF (VTOT .GT. 0.) VTOT=SQRT(VTOT)
   27 MUZ=-VEL*CSKI
      PSIHP=0.
      ALFHP=0.
      IF ((CSJI.NE.0.).OR.(CSII.NE.0.)) PSIHP=ATAN2(-CSJI,CSII)*CVERT
      CSII=CSII**2+CSJI**2
      IF (CSII .GT. 0.) CSII=SQRT(CSII)
      IF ((CSKI.NE.0.).OR.(CSII.NE.0.)) ALFHP=ATAN2(-CSKI,CSII)*CVERT
      ITERM=MAX0(1,ITER)
      IF (OPTRIM .GE. 3) ITERM=ITERM+4
      ITERC=0
    5 ITERC=ITERC+1
      U2=(MU*MU+MUY*MUY)/KFLMDA**2
      X1=.5*CTLMDA
      IF ((OPTRIM.NE.1).AND.(OPTRIM.LE.2).AND.(ITERC.GT.1)) X1=.5*CT*SIG-
     1MA
      X2=KHLMDA**4
      LAMDA=MUZ+X1/SQRT(ABS(X1/X2+VEL*VEL))
      DO 25 I=1,4
      X3=(SQRT(LAMDA*LAMDA/X2+U2))**3
   25 LAMDA=(X3*MUZ+X1*(2.*LAMDA*LAMDA/X2+U2))/(X3+X1*LAMDA/X2)
      IRING=0
      IF (X1 .NE. 0.) X1=SQRT(ABS(X1))
      IF (MU*MU+MUY*MUY+(2.*MUZ+3.*X1)**2 .GE. X1*X1) GO TO 26
      IRING=1
      LAMDA=MUZ*((.373*MUZ*MUZ+.598*(MU*MU+MUY*MUY))/(X1*X1)-1.991)*KHLM-
     1DA+MUZ
   26 CTOS=1.0526*CTLMDA/SIGMA
      U=SQRT(1.+LAMDA*LAMDA)
      TTH=.95*(U**3-LAMDA**3)/FACTOR
      QTH=LAMDA*TTH
      CALL RTRIM(ITERC,CTOS)
      IF ((OPTRIM .LE. 0) .OR. (ITERC .GE. ITERM)) GO TO 6
      IF (OPTRIM .EQ. 1) GO TO 41
      IF (OPTRIM .EQ. 2) GO TO 42
      IF (OPTRIM .EQ. 3) GO TO 43
      IF (OPTRIM .EQ. 4) GO TO 44
   41 IF (ABS((CT-CTTRIM)/CTTRIM) .LT. EPTRIM) GO TO 6
      DELT=(CTTRIM-CT)/TTH
      DO 48 JR=1,51
   48 THETA(JR)=THETA(JR)+DELT
      GO TO 5
   42 IF (ABS((CQ-CQTRIM)/AMAX1(ABS(LAMDA*CT),.001)).LT. EPTRIM) GO TO 6
      DELT=(CQTRIM-CQ)/QTH
      DO 45 JR=1,51
   45 THETA(JR)=THETA(JR)+DELT
      GO TO 5
   43 CLIFT=CT
      SLOPC=BGC
      SLOPS=BGS
      DO 140 JE=NTRIM0,NTRIM1
      SLOPC=SLOPC+B1C(JE)*ETA(JE,1,51)
  140 SLOPS=SLOPS+B1S(JE)*ETA(JE,1,51)
      GO TO (141,142,143,144),ITERC
      SLOPC=SLOPC-BCTRIM/CVERT
      SLOPS=SLOPS-BSTRIM/CVERT
      IF ((ABS((CT-CTTRIM)/CTTRIM) .LT. EPTRIM) .AND. (ABS(SLOPC) .LT. E-
     1PTRIM) .AND. (ABS(SLOPS) .LT. EPTRIM)) GO TO 6
      DELT=DERIV(1)*(CTTRIM-CT)-DERIV(4)*SLOPC-DERIV(7)*SLOPS
      T1C=T1C+DERIV(2)*(CTTRIM-CT)-DERIV(5)*SLOPC-DERIV(8)*SLOPS
      T1S=T1S+DERIV(3)*(CTTRIM-CT)-DERIV(6)*SLOPC-DERIV(9)*SLOPS
      DO 47 JR=1,51
   47 THETA(JR)=THETA(JR)+DELT
      GO TO 5
   44 SLOPC=0.
      IF (VEL .NE. 0.) SLOPC=(-MU*CH+MUY*CY+MUZ*CT)/VEL
      CLIFT=ABS(CT*CT+CH*CH+CY*CY-SLOPC*SLOPC)
      IF (CLIFT .NE. 0.) CLIFT=SQRT(CLIFT)
      SLOPS=CY
      GO TO (141,142,143,144),ITERC
      SLOPC=SLOPC-CXTRIM
      SLOPS=SLOPS-CYTRIM
      IF (((CLIFT-CTTRIM)**2+SLOPC**2+SLOPS**2)/CTTRIM**2 .LT. EPTRIM**2-
     1) GO TO 6
      DELT=DERIV(1)*(CTTRIM-CLIFT)-DERIV(4)*SLOPC-DERIV(7)*SLOPS
      T1C=T1C+DERIV(2)*(CTTRIM-CLIFT)-DERIV(5)*SLOPC-DERIV(8)*SLOPS
      T1S=T1S+DERIV(3)*(CTTRIM-CLIFT)-DERIV(6)*SLOPC-DERIV(9)*SLOPS
      DO 149 JR=1,51
  149 THETA(JR)=THETA(JR)+DELT
      GO TO 5
  141 DO 145 I=1,3
      DERIV(3*I-2)=CLIFT
      DERIV(3*I-1)=SLOPC
  145 DERIV(3*I)=SLOPS
      DO 146 JR=1,51
  146 THETA(JR)=THETA(JR)-.02*FACTOR
      GO TO 5
  142 DERIV(1)=DERIV(1)-CLIFT
      DERIV(2)=DERIV(2)-SLOPC
      DERIV(3)=DERIV(3)-SLOPS
      DO 147 JR=1,51
  147 THETA(JR)=THETA(JR)+.02*FACTOR
      T1C=T1C-.02*FACTOR
      GO TO 5
  143 DERIV(4)=DERIV(4)-CLIFT
      DERIV(5)=DERIV(5)-SLOPC
      DERIV(6)=DERIV(6)-SLOPS
      T1C=T1S+.02*FACTOR
      T1S=T1S-.02*FACTOR
      GO TO 5
  144 DERIV(7)=DERIV(7)-CLIFT
      DERIV(8)=DERIV(8)-SLOPC
      DERIV(9)=DERIV(9)-SLOPS
      T1S=T1S+.02*FACTOR
      DO 148 I=1,9
  148 DERIV(I)=DERIV(I)/(.02*FACTOR**2)
      CALL MINV(DERIV,3,DEN,LMINV,MMINV)
      GO TO 5
    6 PRINT 999
      IF (OPTRIM)61,62,63
   62 PRINT 998
      GO TO 65
   61 PRINT 997
      GO TO 64
   63 PRINT 990, ITERC,ITERM,EPTRIM
      GO TO (161,162,163,164),OPTRIM
  161 PRINT 996, CTTRIM
      GO TO 64
  162 PRINT 995, CQTRIM
      GO TO 64
  163 PRINT 994, CTTRIM,BCTRIM,BSTRIM
      GO TO 64
  164 PRINT 993, CTTRIM,CXTRIM,CYTRIM
   64 CALL RTRIMP
   65 CONTINUE
      EDAMP=0.
      IF (OPTRIM .NE. 0)  EDAMP=EDAMPC*GAMMA*DENSE*CQ*FLOAT(ROTATE)/5.7
      IF (IABS(OPMOTR) .EQ. 3) EDAMP=0.
      RETURN
      END
      SUBROUTINE STRUT(OPSTRT)
      INTEGER OPSTRT
      IF (OPSTRT .EQ. 1) CALL WING
      IF (OPSTRT .EQ. 2) CALL GROUND
      IF (OPSTRT/100 .EQ. 1) CALL RTA
      RETURN
      END
      SUBROUTINE GROUND
C
C   GROUND RESONANCE OR TUNNEL SUPPORT  ---   OPSTRT = 2
C
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (RADIUS,HHR(14)),(NBLADE,HHR(2)),(IB,HHR(32)),(OMEGA,H-
     1HR(13))
      REAL IB
      COMMON /TINPUT/HHT(285)
      EQUIVALENCE (OPUNIT,HHT(162))
      INTEGER OPUNIT
      COMMON /SCOEF/CA(6,10),A2(10,10),A1(10,10),A0(10,10),B(10,3),BG(10-
     1,3),AA(10,6),MXS,MVS
      REAL M(10),C(10),W(10),ZERO(480)
      REAL WUNIT(2)
      INTEGER DIRECT(10),COUNT
      NAMELIST /NLGRND/M,C,W,DIRECT,MXS
      EQUIVALENCE (ZERO(1),CA(1,1))
      DATA COUNT/0/
      DATA WUNIT/32.17,1./
      DO 1 J=1,480
    1 ZERO(J)=0.
      COUNT=COUNT+1
      IF (COUNT .EQ. 1) READ(5,NLGRND)
      CNST=RADIUS*RADIUS*2./(FLOAT(NBLADE)*IB)
      DO 2 J=1,MXS
      A2(J,J)=M(J)*CNST/WUNIT(OPUNIT)
      A1(J,J)=C(J)*CNST/OMEGA
      A0(J,J)=A2(J,J)*(6.283185*W(J)/OMEGA)**2
      IF (DIRECT(J) .LT. 0) GO TO 3
      CA(1,J)=1.
      AA(J,2)=1.
      GO TO 2
    3 CA(2,J)=1.
      AA(J,3)=-1.
    2 CONTINUE
      MVS=0
      RETURN
      END
      SUBROUTINE WING
C
C   PROPROTOR DYNAMIC TEST STAND  ---  OPSTRT = 1
C
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (RADIUS,HHR(14)),(OMEGA,HHR(13)),(NBLADE,HHR(2)),(IB,H-
     1HR(32)),(GAMMA,HHR(12)),(SIGMA,HHR(15))
      REAL IB
      COMMON /TINPUT/HHT(285)
      EQUIVALENCE (OPREAD,HHT(152)),(ATILT,HHT(184)),(VEL,HHT(35)),(DENS-
     1E,HHT(161))
      INTEGER OPREAD
      NAMELIST /NLWNG/DELW1,DELW2,DELW3,YTW,HMAST,HEA,   IQW,MPYLON,IPX,-
     1IPY,SW,CPWQW,CQW1,CQW2,CPW,KQW1,KQW2,KPW,OPWING,ARW,TAUW,CLMAXW,CD-
     2MINW,XAW,CMACW,CW,CFLAP,YFLAPO,YFLAPI,CDFLAP,ETAWP,ZEA,IPW
      REAL IQW,   IPX,IPY,IPW,KQW1,KQW2,KPW,MPYLON
      INTEGER OPWING
      COMMON /WAERO/CQ1DQ1,CQ1DQ2,CQ1DP,CQ1Q1,CQ1Q2,CQ1P,CQ1U,CQ1V,CQ1W,-
     1CQ1D,CQ2DQ1,CQ2DQ2,CQ2DP,CQ2Q1,CQ2Q2,CQ2P,CQ2U,CQ2V,CQ2W,CQ2D,CPDQ-
     21,CPDQ2,CPDP,CPQ1,CPQ2,CPP,CPU,CPV,CPA,CPD
      COMMON /SCOEF/CA(6,10),A2(10,10),A1(10,10),A0(10,10),B(10,3),BG(10-
     1,3),AA(10,6),MXS,MVS
      REAL NIR
      DIMENSION ZERO(30)
      EQUIVALENCE (ZERO(1),CQ1DQ1)
      DATA ETAWP,CPWQW/1.74,.6666667/
      DATA ARW,TAUW,CLMAXW,CDMINW,XAW,CMACW,   CFLAP,YFLAPO,YFLAPI,CDFLA-
     1P/6.6,.135,1.,.0075,-.01,-.005,     .3,1.,.5,.03/
      DATA CVERT/57.29578/
      RR=12.5/RADIUS
      NIR=315./(IB*FLOAT(NBLADE))
      OR=48./OMEGA
      OR2=OR*OR
      CQW1=.88*OR*NIR
      CQW2=2.67*OR*NIR
      CPW=.093*OR*NIR
      KQW1=18.72*OR2*NIR
      KQW2=50.7*OR2*NIR
      KPW=3.595*OR2*NIR
      YTW=1.333*RR
      HMAST=.261*RR
      HEA=.342*RR
      ZEA=0.*RR
      CW=.413*RR
      IQW=4.03*NIR
      IPW=.0141*NIR
      IPX=1.086*NIR
      IPY=1.206*NIR
      MPYLON=76.9*NIR
      SW=2.88*NIR
      DELW1=0.
      DELW2=0.
      DELW3=-6.5
      OPWING=1
      MXS=3
      MVS=1
      IF (OPREAD .GE. 2) READ(5,NLWNG)
      SN=SIN((ATILT-DELW2)/CVERT)
      CS=COS((ATILT-DELW2)/CVERT)
      E=ETAWP
      D1=DELW1/CVERT
      D2=DELW2/CVERT
      D3=DELW3/CVERT
      DO 2 J=1,30
    2 ZERO(J)=0.
      IF (OPWING .EQ. 0) GO TO 3
      CLA=6.283185*ARW/(3.+ARW/(.95*(1.+.75*TAUW)))
      CL=CLA*D2
      CD=CDMINW+CL*CL/(2.7*ARW)
      IF (CL .LE. CLMAXW) GO TO 1
      CL=CLMAXW
      CD=2.*SIN(D2)**2
      CLA=0.
    1 CDA=.75*CL*CLA/ARW
      C1=1.-2.*CFLAP
      C2=SQRT(1.-C1*C1)
      C3=(.95+.05*CFLAP)*(1.+(1.-CFLAP)*.5/ARW)/3.141593
      CLF=(C2+ARCOS(C1))*C3
      CMF=-.25*(1.+C1)*C2*C3
      G=GAMMA/(3.141593*5.7*SIGMA)*VEL*DENSE
      D12=G*CW*YTW*YTW
      D13=G*CW*YTW**3
      D21=G*CW*CW*YTW
      D31=G*CW**3*YTW
      D22=G*(CW*YTW)**2
      D=DELW2/CVERT
      CQ1U=D12*CL*.6666667
      CQ1W=D12*CLA*.3333333
      CQ1V=D1*CQ1W+D3*CQ1U
      CQ1DQ1=-D13*CLA*.2
      CQ1DQ2=-D13*CL*.2
      CQ1Q1=-D12*VEL*D3*CLA*.5
      CQ1Q2=-D12*VEL*D3*CL*.5
      CQ1DP=D22*(.75+XAW)*CLA*.125
      CQ1P=D12*VEL*CLA*.25
      CQ1D=D12*VEL*CLA*CLF*.3333333*(YFLAPO**3-YFLAPI**3)
      CQ2U=D12*(CD-D*CL)*.6666667
      CQ2W=D12*(CDA-2.*CL)*.3333333
      CQ2V=D1*CQ2W+D3*CQ2U
      CQ2DQ1=-D13*(CDA-2.*CL)*.2
      CQ2DQ2=-D13*(2.*CD-D*CDA)*.2
      CQ2Q1=-D12*VEL*D3*(CDA-2.*CL)*.5
      CQ2Q2=-D12*VEL*D3*(2.*CD-D*CDA)*.5
      CQ2DP=D22*((.5+XAW)*(CDA-2.*CL)-.25*CL)*.125
      CQ2P=D12*VEL*(CDA-CL)*.25
      CQ2D=D12*VEL*(CDFLAP+(CDA-CL)*CLF)*.3333333*(YFLAPO**3-YFLAPI**3)
      CPU=D21*CMACW
      CPA=-D21*XAW*CLA*.5
      CPV=D1*CPA+D3*CPU
      CPDQ1=D22*XAW*CLA*.25
      CPDQ2=-D22*CMACW*.5
      CPQ1=D12*VEL*CMACW/12.
      CPQ2=-D12*VEL*CL/12.
      CPDP=-D31*(.25+.5*XAW)*CLA*.1666667
      CPP=-D21*VEL*XAW*CLA*.3333333
      CPD=-D21*VEL*(XAW*CLF-CMF)*CLA*.5*(YFLAPO**2-YFLAPI**2)
    3 CONTINUE
      CA(1,1)=YTW*CS-HMAST*E*D3
      CA(1,2)=YTW*SN+HMAST*E*D1
      CA(1,3)=HMAST+CS*(HEA-HMAST)-ZEA*SN
      CA(2,1)=-HMAST*E*SN-YTW*D1
      CA(2,2)=HMAST*E*CS-YTW*D3
      CA(2,3)=-HMAST*(D1*CS+D3*SN)
      CA(3,1)=YTW*SN
      CA(3,2)=-YTW*CS
      CA(3,3)=(HEA-HMAST)*SN+ZEA*CS
      CA(4,1)=E*SN
      CA(4,2)=-E*CS
      CA(4,3)=D1*CS+D3*SN
      CA(5,1)=-E*D3
      CA(5,2)=E*D1
      CA(5,3)=1.
      CA(6,1)=-E*CS
      CA(6,2)=-E*SN
      CA(6,3)=D1*SN-D3*CS
      A2(1,1)=IQW+MPYLON
      A2(1,2)=0.
      A2(1,3)=SW
      A2(2,1)=0.
      A2(2,2)=IQW+IPX*E*E+MPYLON
      A2(2,3)=-SW*D2
      A2(3,1)=SW
      A2(3,2)=-SW*D2
      A2(3,3)=IPW+IPY
      A1(1,1)=CQW1-CQ1DQ1
      A1(1,2)=-CQ1DQ2
      A1(1,3)=-CQ1DP
      A1(2,1)=-CQ2DQ1
      A1(2,2)=CQW2-CQ2DQ2
      A1(2,3)=-CQ2DP
      A1(3,1)=-CPDQ1
      A1(3,2)=-CPDQ2
      A1(3,3)=CPW-CPDP
      A0(1,1)=KQW1-CQ1Q1
      A0(1,2)=-CQ1Q2
      A0(1,3)=-CQ1P
      A0(2,1)=-CQ2Q1
      A0(2,2)=KQW2-CQ2Q2
      A0(2,3)=-CQ2P
      A0(3,1)=-CPQ1
      A0(3,2)=-CPQ2
      A0(3,3)=KPW-CPP
      B(1,1)=CQ1D
      B(2,1)=CQ2D
      B(3,1)=CPD
      BG(1,1)=CQ1U
      BG(1,2)=CQ1V
      BG(1,3)=CQ1W
      BG(2,1)=CQ2U
      BG(2,2)=CQ2V
      BG(2,3)=CQ2W
      BG(3,1)=CPU
      BG(3,2)=CPV
      BG(3,3)=CPA
      AA(1,1)=2.*YTW*SN
      AA(1,2)=YTW*CS-HMAST*E*D3
      AA(1,3)=HMAST*E*SN+YTW*D1
      AA(1,4)=2.*E*CS
      AA(1,5)=-E*D3
      AA(1,6)=-E*SN
      AA(2,1)=-2.*YTW*CS
      AA(2,2)=YTW*SN+HMAST*E*D1
      AA(2,3)=-HMAST*E*CS+YTW*D3
      AA(2,4)=2.*E*SN
      AA(2,5)=E*D1
      AA(2,6)=E*CS
      AA(3,1)=2.*(HEA-HMAST)*SN+2.*ZEA*CS
      AA(3,2)=HMAST+(HEA-HMAST)*CS-ZEA*SN
      AA(3,3)=HMAST*(D3*SN+D1*CS)
      AA(3,4)=2.*(D3*CS-D1*SN)
      AA(3,5)=1.
      AA(3,6)=-D3*SN-D1*CS
      RETURN
      END
      SUBROUTINE RTA
C
C   ROTOR TEST APPARATUS     ---     OPSTRT = 10X
C
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (RADIUS,HHR(14)),(OMEGA,HHR(13)),(NBLADE,HHR(2)),(IB,H-
     1HR(32))
      REAL IB
      COMMON /TINPUT/HHT(285)
      EQUIVALENCE (OPREAD,HHT(152)),(OPSTRT,HHT(23)),(RST(1,1),HHT(167))
      REAL RST(3,3)
      INTEGER OPREAD,OPSTRT
      COMMON /SCOEF/CA(6,10),A2(10,10),A1(10,10),A0(10,10),B(10,3),BG(10-
     1,3),AA(10,6),MXS,MVS
      REAL ZERO(480)
      EQUIVALENCE (ZERO(1),CA(1,1))
      REAL MASS(7,6),FREQ(7,6),DAMPB(7,6),DAMPG(7,6),ZETAR(3,7,6),GAMAR(-
     13,7,6),NMODE(6)
      REAL W(7),C(7),G(7),MND
      NAMELIST /NLRTA/DAMPER,W,C,G
      INTEGER COUNT
      DATA COUNT/0/
      DATA MASS/2767.1,2457.,3730.1,1359.5,476.04,198.46,5082.,7*0.,944.-
     159,439.44,113.16,4*0.,1925.2,15644.,952.76,1795.9,594.01,255.73,51-
     237.2,7*0.,944.87,415.63,120.91,4*0./
      DATA FREQ/1.76,2.32,2.67,4.02,4.50,6.34,7.34,7*0.,3.07,3.47,4.49,4-
     1*0.,1.72,2.36,2.15,3.04,3.52,4.59,7.34,7*0.,2.27,2.45,3.27,4*0./
      DATA DAMPB/3800.,2000.,0.,1500.,3400.,0.,9000.,14*0.,2500.,15000.,-
     1120.,2800.,2000.,0.,9000.,14*0./
      DATA DAMPG/1300.,1000.,2000.,500.,600.,5000.,6500.,7*0.,500.,400.,-
     15000.,4*0.,650.,5000.,350.,800.,1500.,5000.,6500.,7*0.,440.,300.,5-
     2000.,4*0./
      DATA ZETAR/1.,0.,-.01098,0.,1.,2*0.,1.,0.,1.,0.,-.02087,0.,1.,2*0.-
     1,.12295,0.,-.00856,0.,1.,21*0.,1.,3*0.,1.,2*0.,.2485,0.,12*0.,1.,0-
     2.,-.0084,0.,1.,2*0.,1.,0.,1.,0.,-.0084,0.,1.,2*0.,.1003,0.,.02953,-
     30.,1.,21*0.,1.,3*0.,1.,2*0.,.22354,0.,12*0./
      DATA GAMAR/0.,.00205,0.,-.00128,0.,.07685,-.00400,0.,-.01964,0.,.0-
     10442,0.,-.00185,0.,.07651,.00278,0.,.05,0.,.00843,0.,21*0.,5*0.,.0-
     24827,2*0.,.05,12*0.,0.,.00157,0.,-.00538,0.,-.12932,-.00140,0.,.05-
     3417,0.,.00164,0.,-.00032,0.,.08948,.00107,0.,.05,0.,.00921,0.,21*0-
     4.,5*0.,.05284,2*0.,.05,12*0./
      DATA NMODE/7,7,3,7,7,3/
      DO 1 I=1,480
    1 ZERO(I)=0.
      COUNT=COUNT+1
      IF (COUNT .GE. 2) GO TO 2
      DAMPER=0.
      ICASE=OPSTRT-100
      IF ((OPSTRT .NE. 102) .AND. (OPSTRT .NE. 105)) GO TO 11
      DAMPER=1.
      ICASE=ICASE-1
   11 MXS=NMODE(ICASE)
      DO 10 I=1,MXS
      W(I)=FREQ(I,ICASE)
      C(I)=DAMPB(I,ICASE)
   10 G(I)=DAMPG(I,ICASE)
      IF (OPREAD .GE. 2) READ (5,NLRTA)
    2 MXS=NMODE(ICASE)
      MVS=0
      CNST=RADIUS**2*2./(FLOAT(NBLADE)*IB)
      DO 20 I=1,MXS
      MND=MASS(I,ICASE)*CNST
      FND=W(I)*6.283185/OMEGA
      A2(I,I)=MND
      A1(I,I)=DAMPER*C(I)*CNST/OMEGA+G(I)*CNST/OMEGA
      A0(I,I)=MND*FND**2
      DO 20 K=1,3
      DO 20 J=1,3
      CA(K,I)=CA(K,I)+RST(K,J)*ZETAR(J,I,ICASE)
   20 CA(K+3,I)=CA(K+3,I)+RST(K,J)*GAMAR(J,I,ICASE)*RADIUS
      DO 21 I=1,MXS
      AA(I,1)= 2.*CA(3,I)
      AA(I,2)=    CA(1,I)
      AA(I,3)=   -CA(2,I)
      AA(I,4)=-2.*CA(6,I)
      AA(I,5)=    CA(5,I)
   21 AA(I,6)=   -CA(4,I)
      RETURN
      END
      BLOCK DATA
      COMMON /RINPUT/TYPE,NBLADE,DEL3G,NTRIM0,NTRIM1,MU,LAMDA,MTIP,NBM,N-
     1TM,GIMBAL,GAMMA,OMEGA,RADIUS,SIGMA,OPAERO,MRAERO,BBLD,RROOT,INCOMP-
     2,TRC,TRS,TR0,MPSI,MREV,OPMODE,OFFSET,MRMODE,NONROT,NCOLB,CONE,IB,D-
     3EL1,XFA,KPG,GGS,GQS(5),GPS(3),NCOLT,WT0,RFA,HSPRC,HSPRS,KPB(5),RPH-
     4,XPH,WTCH,WTSH,WTRH,WTC,WTS,WTR,NUGC,NUGS,KFLAP,KLAG,HINGE,KPIN,AT-
     5ANKP(5),DROOP,SWEEP,DEL2,DEL3,ZFA,VTIPN,DEBUGR,EPMODE,GLAG,LDAMP,E-
     6XDAMP,PHIPH,PHIPL,LDAMPC,MUY,MUZ,CHORD(51),XA(51),MASS(51),XI(51),-
     7THETA(51),ITHETA(51),TWIST(51),EIZZ(51),EIXX(51),GJ(51),XC(51),DEN-
     8SER,OPUNIR,ELAG,VTOT,KHLMDA,KFLMDA,ALFHP,PSIHP,T75IN,T1CIN,T1SIN,I-
     9RING,ROTATE,FDROOP,FSWEEP,DEL4,DEL5
      REAL MU,LAMDA,MTIP,IB,MASS,ITHETA,KPG,NUGC,NUGS,KPB,KFLAP,KLAG,LDA-
     1MP,LDAMPC,MUY,MUZ,KHLMDA,KFLMDA
      INTEGER OPAERO,GIMBAL,OPMODE,HINGE,DEBUGR,OPUNIR,ROTATE
C  COMMON/RINPUT/ VARIANCES:    T75->TR0, T1C->TRC, T1S->TRS
      COMMON /TINPUT/TITLE(18),ASHAFT,IMOTOR,RTRANS,OPTRIM,OPSTRT,CON(11-
     1),VEL,VKTS,DOF(40), OPLMDA,GUST(3),OPMOTR,OPFLOW,MPER,JCNST,DEBUG,-
     2NSYSAN,NSTEP,NFREQ,ITER,CQTRIM,CTTRIM,EPTRIM,FACTOR,PLOTMX,LOCUS,R-
     3ESPON,NF,DOFP(40),CONP(14),OPREAD,EDAMPC,VTIP,RPM,T75,T1C,T1S,CTLM-
     4DA,OPTORS,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST(3,3),EDAMP,-
     5KMAST,KICS,KPGOVR,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR,FREQ(100)
      REAL IMOTOR,KMAST,KICS,KPGOVR,KIGOVR
      INTEGER OPTRIM,OPSTRT,DOF,CON,GUST,OPMOTR,OPFLOW,DEBUG,RESPON,DOFP-
     1,CONP,OPLMDA,OPREAD,OPTORS,OPUNIT,ORIENT,OPGOVR
      DATA TITLE/72HCUTDOWN H-34 ROTOR   ---    GROUND RESONANCE DYNAMIC-
     1S                   /
      DATA DOF/8*1,22*0,4*1,6*0/
      DATA CON,GUST/11*0,3*0/
      DATA ORIENT,ASHAFT,AYAW,ACANT,ATILT/1,4*0./
      DATA T75,T1C,T1S,CTLMDA/5.,0.,0.,.0028/
      DATA DENSE,OPUNIT/1.,1/
      DATA OPFLOW,OPTORS,OPTRIM,OPREAD/0,1,-1,0/
      DATA OPSTRT/2/
      DATA DEBUG/0/
      DATA MPER,JCNST/30,12/
      DATA EPMODE,EPTRIM,CQTRIM,CTTRIM,FACTOR/.001,.001,0.,0.,.75/
      DATA BCTRIM,BSTRIM,CXTRIM,CYTRIM/4*0./
      DATA NTRIM0,NTRIM1,MPSI,MREV,ITER/1,2,24,10,1/
      DATA NSYSAN,NSTEP,NFREQ,FREQ/0,0,0,100*0./
      DATA LOCUS,PLOTMX,RESPON,NF,DOFP,CONP/0,2.49,0,100,40*0,14*0/
      DATA IMOTOR,RTRANS,EDAMPC,OPMOTR/50.,6.8,10.,2/
      DATA KMAST,KICS/1.,1./
      DATA OPGOVR,KPGOVR,KIGOVR/0,0.,0./
      DATA OPLMDA/1/
C
      DATA TYPE/4HH34S/
      DATA VTIPN/700./
      DATA INCOMP,OPAERO,OPMODE/1,1,1/
      DATA MRAERO,MRMODE,NONROT,NCOLB,NCOLT/9,40,0,2,2/
      DATA GIMBAL,NBLADE,GAMMA,RADIUS,SIGMA/0,4,5.51,17.,.1024/
      DATA CHORD,XA,XI,XC/51*.0804,51*0.,51*0.,51*0./
      DATA BBLD,RROOT/.97,.1/
      DATA IB,OFFSET/281.,.059/
      DATA ELAG/.059/
      DATA ROTATE/1/
      DATA KHLMDA,KFLMDA/1.2,1.05/
      DATA FDROOP,FSWEEP/0.,0./
      DATA MASS/.1,.1,.1,2.05,2.05,2.05,1.77,.612,.586,.399,.177,.119,.1-
     119,.131,6*.138,26*.179,.306,.347,.339,.093,.01/
      DATA ITHETA,TWIST,EIZZ,EIXX,GJ/51*.016,51*0.,51*102100.,51*1107000-
     1.,51*122200./
      DATA GGS,GQS,GPS/0.,5*.01,3*.01/
      DATA WT0,WTCH,WTSH,WTRH/5.5,5.5,5.5,5.5/
      DATA CONE,DROOP,SWEEP,XFA,ZFA,RFA/0.,0.,0.,0.,0.,.061/
      DATA KPIN,ATANKP,RPH,XPH,PHIPL,PHIPH,DEL3G/2,5*0.,.059,.1,0.,0.,0.-
     1/
      DATA HINGE,KFLAP,KLAG,HSPRC,HSPRS/0,0.,0.,0.,0./
      DATA LDAMP,EXDAMP/1700.,-1./
      END
      BLOCK DATA
      COMMON /RINPUT/TYPE,NBLADE,DEL3G,NTRIM0,NTRIM1,MU,LAMDA,MTIP,NBM,N-
     1TM,GIMBAL,GAMMA,OMEGA,RADIUS,SIGMA,OPAERO,MRAERO,BBLD,RROOT,INCOMP-
     2,TRC,TRS,TR0,MPSI,MREV,OPMODE,OFFSET,MRMODE,NONROT,NCOLB,CONE,IB,D-
     3EL1,XFA,KPG,GGS,GQS(5),GPS(3),NCOLT,WT0,RFA,HSPRC,HSPRS,KPB(5),RPH-
     4,XPH,WTCH,WTSH,WTRH,WTC,WTS,WTR,NUGC,NUGS,KFLAP,KLAG,HINGE,KPIN,AT-
     5ANKP(5),DROOP,SWEEP,DEL2,DEL3,ZFA,VTIPN,DEBUGR,EPMODE,GLAG,LDAMP,E-
     6XDAMP,PHIPH,PHIPL,LDAMPC,MUY,MUZ,CHORD(51),XA(51),MASS(51),XI(51),-
     7THETA(51),ITHETA(51),TWIST(51),EIZZ(51),EIXX(51),GJ(51),XC(51),DEN-
     8SER,OPUNIR,ELAG,VTOT,KHLMDA,KFLMDA,ALFHP,PSIHP,T75IN,T1CIN,T1SIN,I-
     9RING,ROTATE,FDROOP,FSWEEP,DEL4,DEL5
      REAL MU,LAMDA,MTIP,IB,MASS,ITHETA,KPG,NUGC,NUGS,KPB,KFLAP,KLAG,LDA-
     1MP,LDAMPC,MUY,MUZ,KHLMDA,KFLMDA
      INTEGER OPAERO,GIMBAL,OPMODE,HINGE,DEBUGR,OPUNIR,ROTATE
C  COMMON/RINPUT/ VARIANCES:    T75->TR0, T1C->TRC, T1S->TRS
      COMMON /TINPUT/TITLE(18),ASHAFT,IMOTOR,RTRANS,OPTRIM,OPSTRT,CON(11-
     1),VEL,VKTS,DOF(40), OPLMDA,GUST(3),OPMOTR,OPFLOW,MPER,JCNST,DEBUG,-
     2NSYSAN,NSTEP,NFREQ,ITER,CQTRIM,CTTRIM,EPTRIM,FACTOR,PLOTMX,LOCUS,R-
     3ESPON,NF,DOFP(40),CONP(14),OPREAD,EDAMPC,VTIP,RPM,T75,T1C,T1S,CTLM-
     4DA,OPTORS,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST(3,3),EDAMP,-
     5KMAST,KICS,KPGOVR,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR,FREQ(100)
      REAL IMOTOR,KMAST,KICS,KPGOVR,KIGOVR
      INTEGER OPTRIM,OPSTRT,DOF,CON,GUST,OPMOTR,OPFLOW,DEBUG,RESPON,DOFP-
     1,CONP,OPLMDA,OPREAD,OPTORS,OPUNIT,ORIENT,OPGOVR
      DATA    TITLE/72HTILTING PROPROTOR AIRCRAFT DYNAMICS     ---  GIMB
     1ALLED ROTOR            /
      DATA DOF/6*1,18*0,3*1,3*0,3*1,7*0/
      DATA CON,GUST/11*0,3*0/
      DATA T1C,T1S/0.,0./
      DATA ORIENT,ASHAFT,AYAW,ACANT,ATILT/3,4*0./
      DATA DENSE,OPUNIT/1.,1/
      DATA OPFLOW,OPTORS,OPTRIM,OPREAD/0,1,1,0/
      DATA OPSTRT/1/
      DATA NSYSAN,NSTEP,NFREQ,FREQ,MPER,JCNST/0,0,0,100*0.,30,12/
      DATA DEBUG/0/
      DATA IMOTOR,RTRANS,EDAMPC,OPMOTR/.098,35.2,1.,2/
      DATA KMAST,KICS/750000.,1126000./
      DATA OPGOVR,KPGOVR,KIGOVR/1,.0083333,.0166667/
      DATA OPLMDA/1/
      DATA CQTRIM,CTTRIM,EPTRIM,EPMODE,FACTOR/0.,0.,.001,.0010,.75/
      DATA BCTRIM,BSTRIM,CXTRIM,CYTRIM/4*0./
      DATA PLOTMX,LOCUS,RESPON,NF/2.99,-1,-1,101/
      DATA DOFP,CONP/40*0,14*0/
      DATA NTRIM0,NTRIM1,MPSI,MREV,ITER/1,2,24,10,20/
C
      DATA TYPE/4HTILT/
      DATA INCOMP,OPAERO,OPMODE/1,1,1/
      DATA MRAERO,MRMODE,NONROT,NCOLB,NCOLT/9,40,0,2,2/
      DATA VTIPN,GIMBAL,GAMMA,RADIUS,SIGMA,BBLD,RROOT,IB/600.,1,3.83,12.-
     15,.089,.97,.1,105./
      DATA RFA,XFA,ZFA,CONE,DROOP,SWEEP/.091,0.,0.,2.5,0.,0./
      DATA RPH,XPH,PHIPH,PHIPL,KPIN,ATANKP,DEL3G/.017,.063,-20.5,0.,1,5*-
     10.,-15./
      DATA HSPRC,HSPRS,HINGE,KFLAP,KLAG/.0355,.0355,1,0.,0./
      DATA WT0,WTCH,WTSH,WTRH/5.2,4.8,4.8,6.5/
      DATA LDAMP,EXDAMP/0.,-1./
      DATA NBLADE/3/
      DATA OFFSET/.02/
      DATA ELAG/.1/
      DATA ROTATE/1/
      DATA FDROOP,FSWEEP/0.,0./
      DATA KHLMDA,KFLMDA/1.2,1.05/
      DATA GGS,GQS,GPS/.002,5*.01,3*.01/
      DATA CHORD/5*.1133,.1118,.1093,.1069,.1044,.1019,.0995,.0970,.0946-
     1,38*.09333/
      DATA XA/-0.01256,-0.01256,-0.01234,-0.01199,-0.01165,-0.01130,-0.0-
     11095,-0.01061,-0.01026,-0.00991,-0.00957,-0.00922,-0.00887,-0.0085-
     23,-0.00818,-0.00783,-0.00749,-0.00714,-0.00679,-0.00645,-0.00610,--
     30.00575,-0.00541,-0.00506,-0.00471,-0.00437,-0.00402,-0.00367,-0.0-
     40333,-0.00298,-0.00263,-0.00229,-0.00194,-0.00159,-0.00125,-0.0009-
     5,-0.00055,-0.00019,0.00019,0.00055,0.00090,0.00125,0.00159,0.00194-
     6,0.00229,0.00263,0.00298,0.00333,0.00367,0.00393,0.00393/
      DATA MASS/4.513,.638,.807,1.032,1.192,1.156,1.120,.853,.508,.246,.-
     1231,.216,.208,.202,.195,.184,.174,.164,.153,.146,.152,.157,.171,.1-
     289,.201,.197,.193,.189,.186,.182,.179,.175,.171,.168,.164,.161,.15-
     37,.154,.150,.147,.143,.140,.136,.132,.129,.125,.122,.133,.149,.161-
     4,.161/
      DATA XI/.00033,.00033,.00065,.00108,.00151,.00193,.00236,.00285,.0-
     10335,.00393,.00470,.00547,.00649,.00758,.00903,.01153,.01404,.0112-
     21,.00659,.00313,.00313,.00313,.00025,-.00359,-.00639,-.00607,-.005-
     375,-.00545,-.00515,-.00485,-.00453,-.00421,-.00389,-.00357,-.00325-
     4,-.00290,        -.00255,-.00219,-.00181,        -.00144,-.00107,--
     5.00069,-.00028,.00015,.00058,.00103,.00149,.00202,.00258,.003,.003-
     6/
      DATA XC/.00033,.00033,.00065,.00108,.00151,.00193,.00236,.00285,.0-
     10335,.00393,.00470,.00547,.00649,.00758,.00903,.01153,.01404,.0112-
     21,.00659,.00313,.00313,.00313,.00025,-.00359,-.00639,-.00607,-.005-
     375,-.00545,-.00515,-.00485,-.00453,-.00421,-.00389,-.00357,-.00325-
     4,-.00290,        -.00255,-.00219,-.00181,        -.00144,-.00107,--
     5.00069,-.00028,.00015,.00058,.00103,.00149,.00202,.00258,.003,.003-
     6/
      DATA ITHETA/.0334,.0334,.0317,.0293,.0270,.0248,.0226,.0201,.0174,-
     1.0157,.0170,.0184,.0198,.0214,.0230,.0250,.0270,.0262,.0244,.0230,-
     2.0226,.0222,.0220,.0220,.0218,.0211,.0205,.0199,.0193,.0187,.0182,-
     3.0176,.0171,.0165,.0160,.0155,.0150,.0146,.0142,                  -
     5.0139,.0135,.0131,.0128,                                          -
     4.0124,.0121,.0118,.0116,.0113,.0111,.0110,.0110/
      DATA TWIST/34.43,33.49,32.45,31.55,30.79,30.03,29.03,28.03,26.88,2-
     15.58,24.28,23.03,21.78,20.43,18.98,17.53,16.48,15.43,14.20,12.79,1-
     21.38,10.64,9.90,9.03,8.03,7.03,6.43,5.83,5.19,4.51,3.83,3.31,2.79,-
     32.30,1.84,1.38,.83,.275,-.275,-.82,-1.37,-1.86,-2.35,-2.82,-3.27,--
     43.72,-4.14,-4.56,-4.98,-5.40,-5.82/
      DATA EIZZ/1111000.,1111000.,1111000.,1111000.,1215000.,1632000.,20-
     149000.,1911000.,1589000.,1287000.,1045000.,803000.,674000.,582000.-
     2,499000.,445000.,392000.,355000.,323000.,294000.,278000.,261000.,2-
     346000.,232000.,217000.,202000.,188000.,175000.,163000.,151000.,140-
     4000.,129000.,120000.,110000.,101000.,93400.,85300.,78100.,71200.,6-
     54400.,58300.,52200.,47200.,42400.,37800.,33700.,29500.,26100.,2280-
     60.,20400.,20400./
      DATA EIXX/1111000.,1111000.,1111000.,1111000.,1259000.,1851000.,24-
     140000.,3070000.,3720000.,4250000.,4470000.,4680000.,5060000.,54800-
     200.,5660000.,5100000.,4530000.,3980000.,3440000.,3060000.,3160000.-
     3,3250000.,3490000.,3770000.,3960000.,3870000.,3790000.,3690000.,36-
     400000.,3500000.,3410000.,3320000.,3230000.,3150000.,3060000.,29900-
     500.,2910000.,2850000.,2780000.,2710000.,2650000.,2590000.,2530000.-
     6,2470000.,2420000.,2370000.,2320000.,2280000.,2240000.,2210000.,22-
     710000./
      DATA GJ/410000.,410000.,357000.,287000.,256000.,344000.,432000.,40-
     13000.,335000.,271000.,220000.,170000.,142200.,122400.,104900.,9370-
     20.,82600.,74800.,68000.,62000.,58500.,55000.,51900.,48800.,45700.,-
     342600.,39500.,36800.,34200.,31700.,29500.,27200.,24800.,22300.,202-
     400.,19000.,17900.,16500.,15000.,13570.,12290.,11010.,9940.,8940.,7-
     5980.,7100.,6230.,5500.,4820.,4310.,4310./
      END
      BLOCK DATA
      COMMON /RINPUT/TYPE,NBLADE,DEL3G,NTRIM0,NTRIM1,MU,LAMDA,MTIP,NBM,N-
     1TM,GIMBAL,GAMMA,OMEGA,RADIUS,SIGMA,OPAERO,MRAERO,BBLD,RROOT,INCOMP-
     2,TRC,TRS,TR0,MPSI,MREV,OPMODE,OFFSET,MRMODE,NONROT,NCOLB,CONE,IB,D-
     3EL1,XFA,KPG,GGS,GQS(5),GPS(3),NCOLT,WT0,RFA,HSPRC,HSPRS,KPB(5),RPH-
     4,XPH,WTCH,WTSH,WTRH,WTC,WTS,WTR,NUGC,NUGS,KFLAP,KLAG,HINGE,KPIN,AT-
     5ANKP(5),DROOP,SWEEP,DEL2,DEL3,ZFA,VTIPN,DEBUGR,EPMODE,GLAG,LDAMP,E-
     6XDAMP,PHIPH,PHIPL,LDAMPC,MUY,MUZ,CHORD(51),XA(51),MASS(51),XI(51),-
     7THETA(51),ITHETA(51),TWIST(51),EIZZ(51),EIXX(51),GJ(51),XC(51),DEN-
     8SER,OPUNIR,ELAG,VTOT,KHLMDA,KFLMDA,ALFHP,PSIHP,T75IN,T1CIN,T1SIN,I-
     9RING,ROTATE,FDROOP,FSWEEP,DEL4,DEL5
      REAL MU,LAMDA,MTIP,IB,MASS,ITHETA,KPG,NUGC,NUGS,KPB,KFLAP,KLAG,LDA-
     1MP,LDAMPC,MUY,MUZ,KHLMDA,KFLMDA
      INTEGER OPAERO,GIMBAL,OPMODE,HINGE,DEBUGR,OPUNIR,ROTATE
C  COMMON/RINPUT/ VARIANCES:    T75->TR0, T1C->TRC, T1S->TRS
      COMMON /TINPUT/TITLE(18),ASHAFT,IMOTOR,RTRANS,OPTRIM,OPSTRT,CON(11-
     1),VEL,VKTS,DOF(40), OPLMDA,GUST(3),OPMOTR,OPFLOW,MPER,JCNST,DEBUG,-
     2NSYSAN,NSTEP,NFREQ,ITER,CQTRIM,CTTRIM,EPTRIM,FACTOR,PLOTMX,LOCUS,R-
     3ESPON,NF,DOFP(40),CONP(14),OPREAD,EDAMPC,VTIP,RPM,T75,T1C,T1S,CTLM-
     4DA,OPTORS,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST(3,3),EDAMP,-
     5KMAST,KICS,KPGOVR,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR,FREQ(100)
      REAL IMOTOR,KMAST,KICS,KPGOVR,KIGOVR
      INTEGER OPTRIM,OPSTRT,DOF,CON,GUST,OPMOTR,OPFLOW,DEBUG,RESPON,DOFP-
     1,CONP,OPLMDA,OPREAD,OPTORS,OPUNIT,ORIENT,OPGOVR
      DATA    TITLE/72HTILTING PROPROTOR AIRCRAFT DYNAMICS     ---  HING
     1ELESS ROTOR            /
      DATA DOF/0,5*1,20*0,1,3*0,3*1,7*0/
      DATA CON,GUST/11*0,3*0/
      DATA T1C,T1S/0.,0./
      DATA ORIENT,ASHAFT,AYAW,ACANT,ATILT/3,4*0./
      DATA DENSE,OPUNIT/1.,1/
      DATA OPFLOW,OPTORS,OPTRIM,OPREAD/0,1,1,0/
      DATA OPSTRT/1/
      DATA DEBUG/0/
      DATA NSYSAN,NSTEP,NFREQ,FREQ,MPER,JCNST/0,0,0,100*0.,30,12/
      DATA IMOTOR,RTRANS,EDAMPC,OPMOTR/.098,35.2,1.,2/
      DATA KMAST,KICS/750000.,1126000./
      DATA OPGOVR,KPGOVR,KIGOVR/1,.040,.06/
      DATA OPLMDA/1/
      DATA PLOTMX,LOCUS,RESPON,NF/2.99,-1,-1,101/
      DATA DOFP,CONP/40*0,14*0/
      DATA CQTRIM,CTTRIM,EPTRIM,EPMODE,FACTOR/0.,0.,.001,.0010,.75/
      DATA BCTRIM,BSTRIM,CXTRIM,CYTRIM/4*0./
      DATA NTRIM0,NTRIM1,MPSI,MREV,ITER/1,2,24,10,20/
C
      DATA TYPE/4HTILT/
      DATA OPAERO,OPMODE,INCOMP/1,1,1/
      DATA MRAERO,MRMODE,NONROT,NCOLB,NCOLT/9,40,0,2,2/
      DATA NBLADE/3/
      DATA VTIPN,GIMBAL,GAMMA,RADIUS,SIGMA,BBLD,RROOT,IB/525.,0,4.04,13.-
     1,.115,.97,.1,150./
      DATA RFA,RPH,XPH,PHIPL,PHIPH,DEL3G,KPIN,ATANKP/.06,0.,.05,0.,0.,0.-
     1,1,5*0./
      DATA ZFA,DROOP,SWEEP/0.,0.,0./
      DATA CONE,XFA,WT0,WTCH,WTSH/2.5,.00417,5.75,5.3,5.3/
      DATA WTRH/6.5/
      DATA HINGE,KLAG,KFLAP,HSPRC,HSPRS/1,0.,0.,0.,0./
      DATA LDAMP,EXDAMP/0.,-1./
      DATA OFFSET/.07/
      DATA ELAG/.1/
      DATA FDROOP,FSWEEP/0.,0./
      DATA KHLMDA,KFLMDA/1.2,1.05/
      DATA ROTATE/-1/
      DATA GGS,GQS,GPS/0.,5*.01,3*.01/
      DATA CHORD/51*.1208/
      DATA XA/51*.001933/
      DATA XI/16*0.,.000258,.000516,.000773,.001031,.001289,.001547,.001-
     1804,28*.001933/
      DATA XC/16*0.,.000258,.000516,.000773,.001031,.001289,.001547,.001-
     1804,28*.001933/
      DATA XI/16*.0015,.00151,.00153,.00154,.00155,.00156,.00158,.00159,-
     128*.0016/
      DATA MASS/13.83,.259,.259,.244,.212,.181,.162,.143,.129,.121,.113,-
     1.114,.115,.115,.116,.117,.123,.129,.135,.141,.147,.154,.160,.162, -
     2         .160,.157,.157,.156,.156,.155,.154,.154,.154,.154,.153,.1-
     353,.152,.152,.172,.214,.255,.213,.172,.150,.149,5*.147,1.106/
      DATA ITHETA/.00485,.00485,.00485,.00447,.00371,.00295,.00263,.0023-
     11,.00211,.00203,.00194,.00200,.00205,.00209,.00214,.00218,.00627,.-
     201036,.01446,.01855,.02265,.02675,.03086,.03288,.03283, 6*.03278,.-
     303273,.03268,.03263,.03259,       .03254,.03251,.03248,.03245,.032-
     442,.03239,.03236,.03233,.03230,.03228,6*.03226/
      DATA TWIST/6*33.4,29.7,27.5,25.6,24.,22.5,21.2,20.,19.,18.,17.,16.-
     1,15.1,14.2,13.3,12.4,11.6,10.8,10.,9.2,8.5,7.8,7.1,6.4,5.7,5.,4.3,-
     23.6,2.9,2.2,1.5,.9,.3,-.3,-1.,-1.7,-2.4,-3.1,-3.8,-4.5,-5.1,-5.7,--
     36.3,-6.9,-7.5,-8.1/
      DATA EIZZ/3*459000.,406000.,299000.,191300.,153200.,115000.,91400.-
     1,82100.,72900.,68800.,64700.,60600.,56500.,52400.,50500.,48600.,46-
     2700.,44800.,42900.,41000.,39100.,37400.,35800.,34200.,33300.,32500-
     3.,31700.,30800.,29900.,29800.,29700.,29500.,29400.,29200.,28700.,2-
     48200.,27700.,                                                     -
     5      27200.,4*26700.,2*26800.,26700.,26600.,26500.,26400.,26300./
      DATA EIXX/388000.,388000.,388000.,373000.,342000.,310000.,288000.,-
     1266000.,253000.,248000.,243000.,252000.,261000.,270000.,280000.,28-
     29000.,750000.,1212000.,1674000.,2135000.,2597000.,3058000.,3519000-
     3.,3722000.,3667000.,3611000.,3597000.,3583000.,3569000.,3556000.,3-
     4542000.,5*3542000.,3556000.,3569000.,3583000.,3597000.,3611000.,36-
     531000.,3650000.,3671000.,3693000.,6*3715000./
      DATA GJ/855000.,855000.,855000.,771000.,603000.,435000.,365000.,29-
     15000.,246000.,217000.,189000.,176000.,163000.,150000.,137000.,1240-
     200.,126000.,129000.,131000.,134000.,136000.,139000.,141000.,143000-
     3.,4*142000.,141000.,141000.,                                      -
     4            4*140000.,139000.,139000.,142000.,145000.,147000.,1500-
     500.,153000.,156000.,160000.,163000.,167000.,170000.,171000.,173000-
     6.,174000.,175000.,176000./
      END
      SUBROUTINE WTLDE
C
C   ROTOR AND WIND TUNNEL SUPPORT DYNAMICS
C   WAYNE JOHNSON         NASA-ARC/USAAMRDL
C   JANUARY 1976
C
      COMMON /WTCOEF/A2(1600),A1(1600),A0(1600),B0(560),MX,MX1,MV,MVG,DO-
     1F1(40)
      INTEGER DOF1
      COMMON /RCOEF/A2R(30,30),A1R(30,30),A0R(30,30),AA2R(30,6),AA1R(30,-
     16),AA0R(30,6),BR(30,8),BGR(30,3),C2R(6,30),C1R(6,30),C0R(6,30),CA2-
     2R(6,6),CA1R(6,6),CA0R(6,6),DGR(6,3)
      COMMON /SCOEF/CAW(6,10),A2W(10,10),A1W(10,10),A0W(10,10),BW(10,3),-
     1BGW(10,3),AAW(10,6),MXS,MVS
      COMMON /TINPUT/TITLE(18),ASHAFT,IMOTOR,RTRANS,OPTRIM,OPSTRT,CON(11-
     1),VEL,VKTS,DOF(40), OPLMDA,GUST(3),OPMOTR,OPFLOW,MPER,JCNST,DEBUG,-
     2NSYSAN,NSTEP,NFREQ,ITER,CQTRIM,CTTRIM,EPTRIM,FACTOR,PLOTMX,LOCUS,R-
     3ESPON,NF,DOFP(40),CONP(14),OPREAD,EDAMPC,VTIP,RPM,T75,T1C,T1S,CTLM-
     4DA,OPTORS,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST(3,3),EDAMP,-
     5KMAST,KICS,KPGOVR,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR,FREQ(100)
      REAL IMOTOR,KMAST,KICS,KPGOVR,KIGOVR
      INTEGER OPTRIM,OPSTRT,DOF,CON,GUST,OPMOTR,OPFLOW,DEBUG,RESPON,DOFP-
     1,CONP,OPLMDA,OPREAD,OPTORS,OPUNIT,ORIENT,OPGOVR
      COMMON /RINPUT/HHR(667)
      EQUIVALENCE (RADIUS,HHR(14)),(VTIPN,HHR(79)),(NBLADE,HHR(2)),(GIMB-
     1AL,HHR(11)),(NBM,HHR(9)),(NTM,HHR(10)),(OPAERO,HHR(16)),(OPMODE,HH-
     2R(26)),(GAMMA,HHR(12)),(SIGMA,HHR(15)),(MU,HHR(6)),(LAMDA,HHR(7)),-
     3(MUY,HHR(88)),(MUZ,HHR(89)),(KPB(1),HHR(50)),(KPG,HHR(35)),(TRC,HH-
     4R(21)),(TRS,HHR(22)),(IB,HHR(32)),(OMEGA,HHR(13)),(KHLMDA,HHR(655)-
     5),(KFLMDA,HHR(656)),(ROTATE,HHR(663))
      REAL MU,LAMDA,MUY,MUZ,KPG,KPB(5),IB,KHLMDA,KFLMDA
      INTEGER GIMBAL,OPAERO,OPMODE,ROTATE
      NAMELIST /NLWT/TITLE,VEL,VKTS,DOF,CON,GUST,OPMOTR,OPFLOW,MPER,JCNS-
     1T,DEBUG,NSYSAN,NSTEP,NFREQ,FREQ,OPSTRT,ASHAFT,PLOTMX,LOCUS,RESPON,-
     2NF,DOFP,CONP,IMOTOR,RTRANS,IMSTAR,OPTRIM,ITER,CQTRIM,CTTRIM,EPTRIM-
     3,FACTOR,OPLMDA,EDAMP,VTIP,RPM,OPREAD,CTLMDA,OPTORS,EDAMPC,T75,T1C,-
     4T1S,DENSE,OPUNIT,BCTRIM,BSTRIM,CXTRIM,CYTRIM,RST,KMAST,KICS,KPGOVR-
     5,KPGOVC,KIGOVR,ORIENT,AYAW,ACANT,ATILT,OPGOVR
      NAMELIST /NLEQ/A2,A1,A0,B0,MX,MX1,MV,MVG,DOF0,DOF1
      NAMELIST /NLR/A2R,A1R,A0R,AA2R,AA1R,AA0R,BR,BGR,C2R,C1R,C0R,CA2R,C-
     1A1R,CA0R,DGR
      NAMELIST /NLS/ CAW,A2W,A1W,A0W,BW,BGW,AAW,MXS,MVS
      DIMENSION B(440),BG(120),PHI(1800),C2H(6,10),C1H(6,10),C0H(6,10)
      REAL IMSTAR,KPGOVC,CUNIT(2),BGH(30,3),DGH(6,3),CSSTD(2)
      INTEGER DOF0(40)
      EQUIVALENCE (B0(1),B(1)),(B0(441),BG(1))
      EQUIVALENCE (BGH(1,1),B(1)),(DGH(1,1),B(91)),(C0H(1,1),B(1)),(C1H(-
     11,1),B(61)),(C2H(1,1),B(121))
      DATA CSSTD/1117.,340.3/
      DATA CUNIT/.5924838,1.943845/
      DATA CVERT/57.29578/
  999 FORMAT (1H1/1X,18A4,20X,'(EQUATIONS OF MOTION)'//)
  998 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'HELICOPTER',30X,                                                 -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'SHAFT ANGLE (DEG) =',F7.2,14X,                                   -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,13X, -
     6'YAW ANGLE (DEG)   =',F7.2,14X,                                   -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,53X,                                                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  997 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'PROPELLER',31X,                                                  -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'YAW ANGLE (DEG) =',F7.2,16X,                                     -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,53X, -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,53X,                                                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  996 FORMAT (/1X,'OPERATING STATE',29X,'ROTOR ORIENTATION',23X,'ROTOR P-
     1ARAMETERS'/6X,'VELOCITY (KTS) =',F8.2,20X,                        -
     2'PROPROTOR',31X,                                                  -
     3'RADIUS (FT OR M) =',F7.2/6X,'V/(OMEGA*R)    =',F8.4,20X,         -
     4'TILT ANGLE (DEG)   =',F7.2,13X,                                  -
     5'OMEGA (RAD/SEC)  =',F7.2/6X,'TIP SPEED (FPS OR MPS) =',F7.2,13X, -
     6'CRUISE ANGLE (DEG) =',F7.2,13X,                                  -
     7'IB (SLUG-FT2 OR KG-M2) =',F7.0/6X,'ROTATIONAL SPEED (RPM) =',F7.2-
     8,13X,'CANT ANGLE (DEG)   =',F7.2,13X,                             -
     9'NUMBER OF BLADES =',I2/6X,'AIR DENSITY RATIO =',F7.4,58X,'LOCK NU-
     AMBER      =',F7.3/6X,'OPSTRT =',I4,72X,'ROTOR SOLIDITY   =',F7.4)
  994 FORMAT (///1X,'OPTIONS'/                                          -
     110X,'OPFLOW =',I2,10X,'IF 0, AXIAL FLOW/ LT 0, CONSTANT COEFF'/   -
     310X,'OPMOTR =',I2,10X,'IF 0, AUTOROTATION/ IF 1, CONSTANT SPEED/ I-
     AF 2, MOTOR/ IF 3, POWER OUT/ LT 0, ANTISYMMETRIC'/                -
     410X,'OPTORS =',I2,10X,'IF 0, DOF/ IF 1, RIGID/ IF 2, QUASISTATIC'/-
     510X,'OPAERO =',I2,10X,'IF 0, ONLY CLA TERMS IN ROTOR AERODYNAMICS/-
     6 LT 0, NO STALL'/                                                 -
     710X,'OPTRIM =',I2,10X,'IF 0, NO TRIM/LT 0, NO ITER/IF 1, TRIM T/IF-
     B 2, TRIM Q/IF 3, TRIM T AND FLAP/IF 4, TRIM L,X,Y'/               -
     810X,'OPMODE =',I2,10X,'IF 0, RIGID BLADE MODES/ IF 2, READ MODES/ -
     9IF 3, PUNCH MODES/ IF 4, ARTICULATED MODES'/                      -
     C10X,'OPLMDA =',I2,10X,'IF 0, QUASISTATIC INFLOW DYNAMICS'/        -
     D10X,'OPGOVR =',I2,10X,'IF 0, NO GOVERNOR/ IF 1, GOVERNOR/ IF 2, IN-
     EPUT GAINS')
  993 FORMAT (///1X,'ORDER OF VARIABLES'/10X,'DOF = B0,B1C,B1S,BNC,BNS,B-
     1N/2   T0,T1C,T1S,TNC,TNS,TN/2   BGC,BGS,PSI   L0,LC,LS   SUPPORT'/-
     210X,'CON = T0,T1C,T1S,TNC,TNS,TN/2   SUPPORT'/                    -
     310X,'GUST = UG,VG,WG')
  992 FORMAT (///10X,'DOF =',1X,15I1,3X,9I1,3X,3I1,3X,3I1,3X,10I1/10X, '-
     1CON =',1X,8I1,3X,3I1/10X,'GUST =',1X,3I1)
  991 FORMAT (///1X,'COMPUTATION PARAMETERS',20X,'CSYSAN - STEPS =',I4//-
     1/)
  988 FORMAT (1X,'ENGLISH UNITS (FT, SLUG, SEC)')
  987 FORMAT (1X,'METRIC UNITS (M, KG, SEC)')
  984 FORMAT (90X,'CLOCKWISE ROTATION')
  985 FORMAT (90X,'COUNTER-CLOCKWISE ROTATION')
      VEL=0.
      VKTS=0.
      VTIP=0.
      RPM=0.
      READ (5,NLWT)
      IF ((OPUNIT .NE. 1) .AND. (OPUNIT .NE. 2)) OPUNIT=1
      IF ((RPM .NE. 0.) .AND. (VTIP .EQ. 0.)) VTIP=RADIUS*RPM*.1047198
      IF (VTIP .EQ. 0.) VTIP=VTIPN
      IF (RPM .EQ. 0.) RPM=VTIP/RADIUS/.1047198
      IF (VEL .EQ. 0.) VEL=VKTS/VTIP/CUNIT(OPUNIT)
      IF (VKTS .EQ. 0.) VKTS=VEL*VTIP*CUNIT(OPUNIT)
      CSOUND=CSSTD(OPUNIT)
      CALL RTRII(OPREAD,DEBUG,VTIP,T75,T1C,T1S,DENSE,CSOUND,OPUNIT)
      IF (OPFLOW .GT. 0) OPFLOW=-1
      IF ((OPTRIM .EQ. 1) .OR. (OPTRIM .GE. 3)) CTLMDA=CTTRIM*SIGMA
      IF ((OPMOTR .NE. 0) .AND. (IABS(OPMOTR) .NE. 3)) GO TO 126
      CQTRIM=0.
      IF (OPTRIM .GT. 0) OPTRIM=2
  126 CONTINUE
      IF ((OPMOTR.EQ.1).OR.(DOF(27).EQ.0).OR.(OPMOTR.LT.0)) OPGOVR=0
      DO 24 K=1,40
      IF (DOF(K) .NE. 0) DOF(K)=1
      IF (NBLADE .NE. 1) GO TO 125
      IF ((K .GE. 6) .AND. (K .LE. 15)) DOF(K)=0
      IF ((K .GE. 19) .AND. (K .LE. 40)) DOF(K)=0
      GO TO 24
  125 IF (NBLADE .NE. 2) GO TO 24
      IF ((K .GE. 11) .AND. (K .LE. 15)) DOF(K)=0
      IF ((K .GE. 22) .AND. (K .LE. 24)) DOF(K)=0
      DOF(26)=0
   24 CONTINUE
      DO 25 K=1,11
      IF (CON(K) .NE. 0) CON(K)=1
      IF ((K .GT. NBLADE) .AND. (K .LE. 8)) CON(K)=0
      IF ((NBLADE .EQ. 1) .AND. (K .NE. 1)) CON(K)=0
   25 CONTINUE
      DO 26 K=1,3
      IF (GUST(K) .NE. 0) GUST(K)=1
      IF (NBLADE .EQ. 1) GUST(K)=0
   26 CONTINUE
      IF (OPTORS .NE. 1) GO TO 121
      DO 122 K=16,24
  122 DOF(K)=0
      GO TO 123
  121 K1=15+NBLADE
      DO 124 K=16,K1
  124 DOF(K)=1
  123 CONTINUE
      IF (GIMBAL .EQ. 0) DOF(25)=0
      IF (GIMBAL .EQ. 0) DOF(26)=0
      IF (OPMOTR .EQ. 1) DOF(27)=0
      NBM=0
      DO 21 K=1,5
      DO 21 KB=1,NBLADE
      J=(K-1)*NBLADE+KB
      IF (J .GT. 15) GO TO 21
      IF (DOF(J) .NE. 0) NBM=K
   21 CONTINUE
      NBM=MAX0(1,NBM)
      NTM=0
      DO 22 K=1,3
      DO 22 KB=1,NBLADE
      J=(K-1)*NBLADE+KB
      IF (J .GT. 9) GO TO 22
      IF (DOF(J+15) .NE. 0) NTM=K
   22 CONTINUE
      NTM=MAX0(1,NTM)
      PRINT 999, (TITLE(I), I=1,18)
      IF (ORIENT .EQ. 1) PRINT 998, VKTS,RADIUS,VEL,ASHAFT,OMEGA,VTIP,AY-
     1AW,IB,RPM,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ORIENT .EQ. 2) PRINT 997, VKTS,RADIUS,VEL,AYAW,OMEGA,VTIP,IB,R-
     1PM,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ORIENT .EQ. 3) PRINT 996, VKTS,RADIUS,VEL,ATILT,OMEGA,VTIP,ASH-
     1AFT,IB,RPM,ACANT,NBLADE,DENSE,GAMMA,OPSTRT,SIGMA
      IF (ROTATE .EQ. 1)  PRINT 985
      IF (ROTATE .EQ. -1) PRINT 984
      PRINT 994, OPFLOW,OPMOTR,OPTORS,OPAERO,OPTRIM,OPMODE,OPLMDA,OPGOVR
      PRINT 993
      PRINT 992, (DOF(I), I=1,40),(CON(I), I=1,11),(GUST(I), I=1,3)
      PRINT 991, JCNST
      IF (OPUNIT .EQ. 1) PRINT 988
      IF (OPUNIT .EQ. 2) PRINT 987
      CALL MODE
      CALL WTTRIM
      NBLD=NBLADE
      IF (OPFLOW .LT. 0) NBLD=JCNST
      PSI=0.
      IF ((NBLADE.GE.3).AND.(OPFLOW.EQ.0)) CALL ROTOR0
      IF ((NBLADE.GE.3).AND.(OPFLOW.NE.0)) CALL ROTOR(OPFLOW,PSI,NBLD)
      IF (NBLADE .EQ. 2) CALL ROTOR2(OPFLOW,PSI,NBLD)
      IF (NBLADE .EQ. 1) CALL ROTOR1(OPFLOW,PSI,NBLD)
      DO 230 I=1,3
      DO 232 J=1,30
      BGH(J,I)=0.
      DO 232 K=1,3
  232 BGH(J,I)=BGH(J,I)+BGR(J,K)*RST(K,I)
      DO 231 J=1,6
      DGH(J,I)=0.
      DO 231 K=1,3
  231 DGH(J,I)=DGH(J,I)+DGR(J,K)*RST(K,I)
  230 CONTINUE
      DO 233 I=1,3
      DO 234 J=1,30
  234 BGR(J,I)=BGH(J,I)
      DO 233 J=1,6
  233 DGR(J,I)=DGH(J,I)
  235 IF ((OPMOTR .EQ. 0) .OR. (OPMOTR .EQ. 1)) GO TO 236
      IMSTAR=IMOTOR/(FLOAT(NBLADE)*IB)*RTRANS**2
      IF (OPMOTR .LT. 0) GO TO 237
      A2R(27,27)=A2R(27,27)+IMSTAR
      A1R(27,27)=A1R(27,27)+EDAMP
      GO TO 236
  237 CNST1=1.+KICS/KMAST
      A2R(27,27)=A2R(27,27)+IMSTAR/CNST1
      A1R(27,27)=A1R(27,27)+EDAMP/CNST1
      A0R(27,27)=A0R(27,27)+KICS/(FLOAT(NBLADE)*IB*OMEGA**2*CNST1)
  236 CNST1=GAMMA/(SIGMA*5.7)*DENSE
      A2R(28,28)=A2R(28,28)+.85*CNST1
      A2R(29,29)=A2R(29,29)+.22*CNST1
      A2R(30,30)=A2R(30,30)+.22*CNST1
      CNST2=SQRT((MU**2+MUY**2)/KFLMDA**2+LAMDA**2/KHLMDA**4)
      A1R(28,28)=A1R(28,28)+2.*CNST1*(CNST2+(LAMDA-MUZ)*LAMDA/KHLMDA**4/-
     1CNST2)
      A1R(29,29)=A1R(29,29)+CNST1*CNST2
      A1R(30,30)=A1R(30,30)+CNST1*CNST2
      CALL STRUT(OPSTRT)
      DO 31 I=1,30
      DO 31 K=1,30
      JA=(I-1)*40+K
      A2(JA)=A2R(K,I)
      A1(JA)=A1R(K,I)
   31 A0(JA)=A0R(K,I)
      IF (NBLADE .EQ. 1) GO TO 130
      DO 32 I=1,MXS
      DO 32 K=1,30
      JA=(I+29)*40+K
      A2(JA)=0.
      A1(JA)=0.
      A0(JA)=0.
      DO 32 J=1,6
      A2(JA)=A2(JA)+AA2R(K,J)*CAW(J,I)
      A1(JA)=A1(JA)+AA1R(K,J)*CAW(J,I)
   32 A0(JA)=A0(JA)+AA0R(K,J)*CAW(J,I)
      DO 33 I=1,30
      DO 33 K=1,MXS
      JA=(I-1)*40+K+30
      A2(JA)=0.
      A1(JA)=0.
      A0(JA)=0.
      DO 33 J=1,6
      A2(JA)=A2(JA)-AAW(K,J)*C2R(J,I)
      A1(JA)=A1(JA)-AAW(K,J)*C1R(J,I)
   33 A0(JA)=A0(JA)-AAW(K,J)*C0R(J,I)
      DO 34 I=1,MXS
      DO 34 K=1,6
      C2H(K,I)=0.
      C1H(K,I)=0.
      C0H(K,I)=0.
      DO 34 J=1,6
      C2H(K,I)=C2H(K,I)+CA2R(K,J)*CAW(J,I)
      C1H(K,I)=C1H(K,I)+CA1R(K,J)*CAW(J,I)
   34 C0H(K,I)=C0H(K,I)+CA0R(K,J)*CAW(J,I)
      DO 35 I=1,MXS
      DO 35 K=1,MXS
      JA=(I+29)*40+K+30
      A2(JA)=A2W(K,I)
      A1(JA)=A1W(K,I)
      A0(JA)=A0W(K,I)
      DO 35 J=1,6
      A2(JA)=A2(JA)-AAW(K,J)*C2H(J,I)
      A1(JA)=A1(JA)-AAW(K,J)*C1H(J,I)
   35 A0(JA)=A0(JA)-AAW(K,J)*C0H(J,I)
  130 IF (OPFLOW .GT. 0) GO TO 30
      DO 137 I=1,8
      DO 136 K=1,30
      JB=(I-1)*40+K
  136 B(JB)=BR(K,I)
      DO 137 K=1,MXS
      JB=(I-1)*40+K+30
  137 B(JB)=0.
      IF (NBLADE .EQ. 1) GO TO 30
      DO 39 I=1,MVS
      DO 38 K=1,30
      JB=320+(I-1)*40+K
   38 B(JB)=0.
      DO 39 K=1,MXS
      JB=350+(I-1)*40+K
   39 B(JB)=BW(K,I)
      DO 37 I=1,3
      DO 36 K=1,30
      JB=(I-1)*40+K
   36 BG(JB)=BGR(K,I)
      DO 37 K=1,MXS
      JB=(I-1)*40+K+30
      BG(JB)=BGW(K,I)
      DO 37 J=1,6
   37 BG(JB)=BG(JB)+AAW(K,J)*DGR(J,I)
   30 CONTINUE
      IF (OPTORS .EQ. 0) GO TO 40
      IF (OPTORS .EQ. 2) GO TO 41
      JN=40*NBLADE
      DO 42 J=1,JN
   42 B(J)=-A0(J+600)
      DO 141 I=1,NBM
      DO 141 J=1,JN
      JA=(I-1)*JN+J
      IF (JA .GT. 600) GO TO 141
      A0(JA)=A0(JA)-KPB(I)*A0(J+600)
  141 CONTINUE
      IF (GIMBAL .EQ. 0) GO TO 142
      JN=80
      IF (NBLADE .EQ. 2) JN=40
      DO 43 J=1,JN
   43 A0(J+960)=A0(J+960)-KPG*A0(J+640)
  142 IF (OPFLOW .EQ. 0) GO TO 143
      IF (NBLADE .EQ. 2) GO TO 144
      DO 145 J=1,40
  145 A0(J+1040)=A0(J+1040)+TRS*A0(J+640)-TRC*A0(J+680)
      GO TO 143
  144 TCYC=-TRC*SIN(PSI)+TRS*COS(PSI)
      DO 146 J=1,40
  146 A0(J+1040)=A0(J+1040)+TCYC*A0(J+640)
  143 GO TO 40
   41 DO 44 I=1,40
      DO 44 J=1,9
      JA=(I-1)*40+J+15
      A2(JA)=0.
      IF ((I .GE. 28) .AND. (I .LE. 30)) GO TO 44
      A1(JA)=0.
   44 CONTINUE
   40 IF (OPGOVR .EQ. 0) GO TO 50
      KPGOVC=KPGOVR*OMEGA
      IF (OPGOVR .NE. 2) KPGOVC=KPGOVC*AMAX1(0.,AMIN1(1.,ATILT/90.))
      DO 51 I=1,40
      A0(I+1040)=A0(I+1040)-KIGOVR*B(I)
   51 A1(I+1040)=A1(I+1040)-KPGOVC*B(I)
   50 MX=0
      MX1=0
      MX0=0
      MV=0
      MVG=0
      DO 61 I=1,40
      MX=MX+DOF(I)
      DOF1(I)=1
   61 DOF0(I)=1
      IF ((OPFLOW.NE.0).OR.(OPMOTR.LT.0).OR.(OPGOVR.NE.0)) GO TO 67
      DOF1(27)=0
      IF (DOF(27) .NE. 0) MX1=1
   67 DO 66 I=28,30
      DOF1(I)=0
      IF (DOF(I) .EQ. 0) GO TO 66
      MX1=MX1+1
      IF (OPLMDA .NE. 0) GO TO 66
      DOF0(I)=0
      MX0=MX0+1
   66 CONTINUE
      IF (OPTORS .NE. 2) GO TO 62
      DO 63 I=16,24
      IF (DOF(I) .EQ. 0) GO TO 63
      DOF0(I)=0
      MX0=MX0+1
   63 CONTINUE
   62 DO 64 I=1,11
   64 MV=MV+CON(I)
      DO 65 I=1,3
   65 MVG=MVG+GUST(I)
      CALL DERED(40,11,3,DOF,CON,GUST,A2,A1,A0,B,BG,DOF1,DOF0)
      MVX=MX*MV
      MVGX=MX*MVG
      DO 81 I=1,MVGX
      I1=I+MVX
   81 B0(I1)=BG(I)
      MV=MV+MVG
   80 CONTINUE
      IF ((OPLMDA .EQ. 0) .OR. (OPTORS .EQ. 2)) CALL QSTRAN(MX,MX0,MX1,M-
     1V,A2,A1,A0,B0,DOF1,DOF0)
      IF (DEBUG .EQ. 0) GO TO 83
      MXSQ1=MX*MX+1
      IF (MXSQ1 .GT. 1600) GO TO 84
      DO 85 I=MXSQ1,1600
      A2(I)=0.
      A1(I)=0.
   85 A0(I)=0.
   84 MVX1=MX*MV+1
      IF (MVX1 .GT. 560) GO TO 83
      DO 86 I=MVX1,560
   86 B0(I)=0.
   83 CONTINUE
      IF (DEBUG .GE. 2) WRITE(6,NLWT)
      IF (DEBUG .EQ. 3) WRITE(6,NLR)
      IF (DEBUG .EQ. 3) WRITE(6,NLS)
      IF ((DEBUG .EQ. 1) .OR. (DEBUG .EQ. 3)) WRITE(6,NLEQ)
      RETURN
      END
      SUBROUTINE ROTOR1(OPTION,PSI,NBLD)
      INTEGER OPTION
      COMMON /RINPUT/TYPE,NBLADE,DEL3G,NTRIM0,NTRIM1,MU,LAMDA,MTIP,NBM,N-
     1TM,GIMBAL,GAMMA,OMEGA,RADIUS,SIGMA,OPAERO,MRAERO,BBLD,RROOT,INCOMP-
     2,T1C,T1S,T75,MPSI,MREV,OPMODE,OFFSET,MRMODE,NONROT,NCOLB,CONE,IB,D-
     3EL1,XFA,KPG,GGS,GQS(5),GPS(3),NCOLT,WT0,RFA,HSPRC,HSPRS,KPB(5),RPH-
     4,XPH,WTCH,WTSH,WTRH,WTC,WTS,WTR,NUGC,NUGS,KFLAP,KLAG,HINGE,KPIN,AT-
     5ANKP(5),DROOP,SWEEP,DEL2,DEL3,ZFA,VTIPN,DEBUGR,EPMODE,GLAG,LDAMP,E-
     6XDAMP,PHIPH,PHIPL,LDAMPC,MUY,MUZ,CHORD(51),XA(51),MASS(51),XI(51),-
     7THETA(51),ITHETA(51),TWIST(51),EIZZ(51),EIXX(51),GJ(51),XC(51),DEN-
     8SER,OPUNIR,ELAG,VTOT,KHLMDA,KFLMDA,ALFHP,PSIHP,T75IN,T1CIN,T1SIN,I-
     9RING,ROTATE,FDROOP,FSWEEP,DEL4,DEL5
      REAL MU,LAMDA,MTIP,IB,MASS,ITHETA,KPG,NUGC,NUGS,KPB,KFLAP,KLAG,LDA-
     1MP,LDAMPC,MUY,MUZ,KHLMDA,KFLMDA
      INTEGER OPAERO,GIMBAL,OPMODE,HINGE,DEBUGR,OPUNIR,ROTATE
      COMMON /MODES/ETA(5,2,51),ETAP(5,2,51),ETAPP(5,2,51),NU(5),ZETA(3,-
     151),ZETAP(3,51),WT(3),EFA(5,2),EFAP(5,2),EFAPP(5,2)
      REAL NU
      COMMON /BAERO/MQU(5),MQDZ(5),MQZ(5),MQL(5),MQDB(5),MQB(5),MQDQ(5,5-
     1),MQQ(5,5),MQP(5,3),MMU,MDZ,MZ,ML,MDB,MB,MDQ(5),MQ(5),MP(3),TU,TDZ-
     2,TZ,TL,TDB,TB,TDQ(5),TQ(5),TP(3),HU,HDZ,HZ,HL,HDB,HB,HDQ(5),HQ(5),-
     3HP(3),QU,QDZ,QZ,QL,QDB,QB,QDQ(5),QQ(5),QP(3),RR,RU,RDZ,RZ,RL,RDB,R-
     4B,RDQ(5),RQ(5),RP(3),MPU(3),MPDZ(3),MPZ(3),MPL(3),MPDB(3),MPB(3),M-
     5PDQ(3,5),MPQ(3,5),MPP(3,3),MPDP(3,3),FZ0,FX0
      REAL MQU,MQDZ,MQZ,MQL,MQDB,MQB,MQDQ,MQQ,MQP,MMU,MDZ,MZ,ML,MDB,MB,M-
     1DQ,MQ,MP,MPU,MPDZ,MPZ,MPL,MPDB,MPB,MPDQ,MPQ,MPP,MPDP
      COMMON /BINERT/   I0,SQ(5,2),IQA(5,2),SPA(3,2),IDQA(5),IDQP(5),IQ(-
     15),SQDDP(5,3),SQP(5,3),IQDQ(5,5),IP(3),SP(3,2),IPA(3,2),SPDDA(3),S-
     2PDDQ(3,5),SPQ(3,5),IPDDP(3,3),IPP(3,3),XATOR(3,2,51),DXATOR(3,5,2,-
     351),MASSB,IQDP(5),IDQA0
      REAL MASSB,I0,IQA,IDQA,IDQP,IQ,IQDQ,IP,IPA,IPDDP,IPP,IQDP,IDQA0
      COMMON /RCOEF/A2(30,30),A1(30,30),A0(30,30),AA2(30,6),AA1(30,6),AA-
     10(30,6),B(30,8),BG(30,3),C2(6,30),C1(6,30),C0(6,30),CA2(6,6),CA1(6-
     2,6),CA0(6,6),DG(6,3)
      DIMENSION ZERO(4236)
      EQUIVALENCE (ZERO(1),A2(1,1))
      DO 1 I=1,4236
    1 ZERO(I)=0.
      H=1./FLOAT(NBLD)
      DPSI=6.283185/FLOAT(NBLD)
      G=GAMMA/FLOAT(NBLD)*DENSER
      IRE=IFIX(ELAG*50.)+2
      DO 4 JPSI=1,NBLD
      IF (OPTION .EQ. 0) PSIM=0.
      IF (OPTION .LT. 0) PSIM=FLOAT(JPSI)*DPSI
      IF (OPTION .GT. 0) PSIM=PSI
      CALL INERT(PSIM)
      DO 11 K=1,NBM
      C=IQ(K)*H
      A2(K,K)=A2(K,K)+C
      A1(K,K)=A1(K,K)+C*GQS(K)*NU(K)
      A0(K,K)=A0(K,K)+C*NU(K)**2
      DO 13 I=1,NBM
   13 A1(K,I)=A1(K,I)+(2.*IQDQ(K,I)+GLAG*ETAP(K,2,IRE)*ETAP(I,2,IRE))*H
      DO 15 I=1,NTM
      A2(K,I+15)=A2(K,I+15)-SQDDP(K,I)*H
   15 A0(K,I+15)=A0(K,I+15)-SQP(K,I)*H
   11 CONTINUE
      DO 18 K=1,NTM
      DO 19 I=1,NBM
      A2(K+15,I)=A2(K+15,I)-SPDDQ(K,I)*H
      A0(K+15,I)=A0(K+15,I)-SPQ(K,I)*H
      IF (K .EQ. 1) A0(K+15,I)=A0(K+15,I)+KPB(I)*IP(1)*WT(1)*H
   19 CONTINUE
      C=IP(K)*H
      A2(K+15,K+15)=A2(K+15,K+15)+C
      A1(K+15,K+15)=A1(K+15,K+15)+C*GPS(K)*WT(K)
      A0(K+15,K+15)=A0(K+15,K+15)+C*WT(K)**2
      IF (K .EQ. 1) B(16,1)=B(16,1)+C*WT(1)**2
      DO 22 I=1,NTM
      A2(K+15,I+15)=A2(K+15,I+15)+IPDDP(K,I)*H
   22 A0(K+15,I+15)=A0(K+15,I+15)+IPP(K,I)*H
   18 CONTINUE
      CALL AERO(PSIM)
      DO 41 K=1,NBM
      DO 42 I=1,NBM
      A1(K,I)=A1(K,I)-G*MQDQ(K,I)
   42 A0(K,I)=A0(K,I)-G*MQQ(K,I)
      DO 44 I=1,NTM
   44 A0(K,I+15)=A0(K,I+15)-G*MQP(K,I)
   41 CONTINUE
      DO 46 K=1,NTM
      DO 47 I=1,NBM
      A1(K+15,I)=A1(K+15,I)-G*MPDQ(K,I)
   47 A0(K+15,I)=A0(K+15,I)-G*MPQ(K,I)
      DO 49 I=1,NTM
      A1(K+15,I+15)=A1(K+15,I+15)-G*MPDP(K,I)
   49 A0(K+15,I+15)=A0(K+15,I+15)-G*MPP(K,I)
   46 CONTINUE
    4 CONTINUE
      RETURN
      END
